def pixmap(self): if self.facing not in self._images: pix = QPixmap("tank/%s_%s.png" % (self.color, state.facing_to_string(self.facing))) self._images[self.facing] = pix return self._images[self.facing]
def __init__(self, fired_by, facing): self.speed = 2 self.facing = facing self.fired_by = fired_by self.pixmap = QPixmap("tank/bullet_%s.png" % state.facing_to_string(self.facing))