def update(self): GameObject.update(self) self.frame_counter.run() if tower_defense.game_object.hasTower == True: if self.frame_counter.flag: tower_defense.game_object.hasEnemy = True if tower_defense.game_object.score < 60: pass elif tower_defense.game_object.score >= 60 and tower_defense.game_object.score < 65: self.frame_counter = FrameCounter(80) boss = Boss(425, 0) boss.HP = 7 add(boss) elif tower_defense.game_object.score >= 120 and tower_defense.game_object.score < 130: self.frame_counter = FrameCounter(50) boss = Boss(425, 0) boss.HP = 13 add(boss) elif tower_defense.game_object.score <= 130: self.frame_counter = FrameCounter(80) boss = Boss(425, 0) boss.HP = 20 add(boss) elif tower_defense.game_object.score >= 210: self.frame_counter = FrameCounter(80) boss = Boss(425, 0) boss.HP = 100 # boss.renderer = Animation(list_super_boss,loop=True,frame_delay=1) add(boss) self.frame_counter.reset()
def update(self): GameObject.update(self) self.pyshicsWithEnemy() # print(self.HP) if self.HP == 0: game_over = GameOverScene() global_scene_manager.change_scene(game_over) self.deactivate()
def __init__(self, x, y): GameObject.__init__(self, x, y) self.box_collider = BoxCollider(50, 50) self.first_move = False self.sec_move = False self.renderer = Animation(list_enemy, loop=True, frame_delay=1) self.stun = False self.stunCooldown = 20 self.isDeath = False
def __init__(self,x,y): GameObject.__init__(self,x,y-20) self.frame_counter = FrameCounter(30) self.shoot_lock = False self.box_collider = BoxCollider(64,80) # self.tower_circle = Tower_circle(0,0) self.rangeCheck = False self.range = 0 self.enemy_x = tower_defense.game_object.get_position_from_main[0] self.enemy_y = tower_defense.game_object.get_position_from_main[1] self.renderer = Animation(list_tower_aoe,loop=True,frame_delay=30)
def __init__(self,x,y,e_x,e_y): GameObject.__init__(self,x,y) self.box_collider = BoxCollider(15,15) self.renderer = Animation(list_bullet_shotgun,loop=True,frame_delay=1) self.e_x = e_x self.e_y = e_y self.cooldown = 80 self.velocity = (0,0) self.vectorX = 0 self.vectorY = 0 self.velocityX = 0 self.velocityY = 0
def update(self): GameObject.update(self) if self.stun: self.renderer = Animation(enemy_stun, loop=True, frame_delay=1) self.stunCooldown -= 1 if self.stunCooldown == 0: self.renderer = Animation(list_enemy, loop=True, frame_delay=1) self.stun = False self.stunCooldown = 20 if not self.stun: self.enemy_move(3) self.deactivate_if_need()
def update(self): # print(self.velocityX, self.vectorY) GameObject.update(self) self.pyshicsWithEnemy() self.move() self.x += self.velocityX self.y += self.velocityY self.cooldown -= 1 if self.cooldown <= 0: self.deactivate() self.cooldown = 80 if self.x == self.e_x and self.y == self.e_y: self.deactivate()
def __init__(self,x,y): GameObject.__init__(self,x,y) self.renderer = Animation(["images/gameover1.png", "images/gameover2.png", "images/gameover3.png", "images/gameover4.png", "images/gameover5.png", "images/gameover6.png", "images/gameover7.png", "images/gameover8.png",],loop = True,frame_delay=10) # def update(self): # GameObject.update(self) # if global_input_manager.enter_pressed: # gameplay_scene = GamePlayScene() # global_scene_manager.change_scene(gameplay_scene)
def __init__(self, x, y): GameObject.__init__(self, x, y) self.renderer = Animation([ "images/gamestartscreen1.png", "images/gamestartscreen2.png", "images/gamestartscreen3.png", "images/gamestartscreen4.png", "images/gamestartscreen5.png", "images/gamestartscreen6.png", "images/gamestartscreen7.png", "images/gamestartscreen8.png", "images/gamestartscreen9.png", "images/gamestartscreen10.png", "images/gamestartscreen11.png", ], loop=True, frame_delay=10)
def __init__(self, x, y): GameObject.__init__(self, x, y) self.renderer = ImageRenderer("images/castle.png") self.box_collider = BoxCollider(70, 70) self.HP = 5
def update(self): GameObject.update(self) if global_input_manager.enter_pressed: gameplay_scene = GamePlayScene() global_scene_manager.change_scene(gameplay_scene)
def update(self): GameObject.update(self) self.check()
def __init__(self, x, y): GameObject.__init__(self, x, y) self.renderer = Animation(enemydie)
def __init__(self,x,y): GameObject.__init__(self,x,y)
def __init__(self, x, y): GameObject.__init__(self, 0, 200) self.frame_counter = FrameCounter(120)
def __init__(self, width, height): GameObject.__init__(self, 0, 0) self.width = width self.height = height
def __init__(self, x, y): GameObject.__init__(self, x, y) self.builded = False self.box_collider = BoxCollider(70, 70) self.renderer = ImageRenderer("images/hole.png")