I want to create somekind of deteriorating shields for my college project, so I went with this kind of implementation. But for some reason when I start my game it completly freeze's. Is it because I didn't write my code in a correct way? Can someone try to correct it.


I have a class, looking like this:

from PyQt5.QtWidgets import QLabel

col = 14
row = 8


class ShieldLabel:
def __init__(self, pix, x, y, width, height):
self.livingObjects = [row][col]

for i in range(0, row):
for j in range(0, col):
self.shieldPart = QLabel()
self.shieldPart.setPixmap(pix)
self.shieldPart.setGeometry(x + (i * 8), y + (j * 8), width, height)
self.setStyleSheet("background:transparent")

self.livingObjects[i, j] = self.shieldPart

And in my main I call it like this: (it's in a loop because I want 4 objects of 2d array from my class above)
def show_shields(self):
for i in range(0, 4):
new_shield = ShieldLabel(QPixmap("Images/shieldPart.png"), 120 + (i * 300), 480, 80, 80)
self.shieldArray.append(new_shield)