def attack(self): if self.isAttacking == True: pass elif self.attackDelay == 0: if self.direction == "left": facing = -1 if self.direction == "right": facing = 1 if self.direction == "none": facing = 0 self.sword = Sword(self.rect.x, self.rect.y, 40, 20, facing) self.level.enemy_attack_list.add(self.sword) self.isAttacking = True self.attackDelay = 30
def attack(self): if self.isAttacking == True: pass else: # print(self.playerID, " is attacking!") if self.direction == "left": facing = -1 if self.direction == "right": facing = 1 if self.direction == "none": facing = 0 self.sword = Sword(self.rect.x, self.rect.y, 25, 10, self.color, facing) if self.isAI: self.level.player_attack_list.add(self.sword) else: self.level.enemy_attack_list.add(self.sword) self.isAttacking = True
##print("Handcannon info:") ##print(weaponList[1].handCannon, weaponList[1].hcAttributes,weaponList[1].hcList) weaponList.append(ar.AutoRifle()) ##print("Auto rifle info:") ##print(weaponList[2].autoRifle, weaponList[2].autoRifleAttributes,weaponList[2].autoRifleList) weaponList.append(scr.ScoutRifle()) ##print("Scout rifle info:") ##print(weaponList[3].scoutRifle, weaponList[3].scoutRifleAttributes,weaponList[3].scoutRifleList) weaponList.append(smg.SMG()) ##print("SMG info:") ##print(weaponList[4].smg, weaponList[4].smgAttributes,weaponList[4].smgList) weaponList.append(sw.Sword()) ##print("Sword info:") ##print(weaponList[5].sword, weaponList[5].swordAttributes) weaponList.append(gr.Grenade()) ##print("Grenade launcher info:") ##print(weaponList[6].grenade, weaponList[6].grenadeLauncherAttributes,weaponList[6].grenadeLauncherList) weaponList.append(ro.Rocket()) ##print("Rocket launcher info:") ##print(weaponList[7].rocket, weaponList[7].rocketAttributes,weaponList[7].rocketLauncherList) weaponList.append(ma.Machine()) ##print("Machine gun info:") ##print(weaponList[8].machine, weaponList[8].machineGunAttributes,weaponList[8].machineGunList)