def turnLeft(self): if not self.fuel: tankPrint("You don't have any fuel!") return self.direction = Tank.toLeft[self.direction] self.aim = Tank.toLeft[self.aim] self.lower = rot_center(self.lower, 90) self.upper = rot_center(self.upper, 90)
def __init__(self,x,y, aim): self.image = pygame.image.load(os.path.join('Images','bullet.png')).convert_alpha() if aim == 'up': pass elif aim == 'right': self.image = rot_center(self.image, 270) elif aim == 'down': self.image = rot_center(self.image, 180) elif aim == 'left': self.image = rot_center(self.image, 90) else: assert False self.lifeTime = Bullet.existTime self.rect = self.image.get_rect() self.rect.x = x self.rect.y = y self.direction = aim Bullet.bullets.append(self)
def towerRight(self): #it shuld be turret not tower, but I am too lazy to change now if not self.fuel: tankPrint("You don't have any fuel!") return self.aim = Tank.toRight[self.aim] self.upper = rot_center(self.upper, 270)