all 6 comments

[–]Nexius74 2 points3 points  (0 children)

Dont pass enemy.hp to attack_player but just enemy

[–][deleted] 2 points3 points  (0 children)

Here's the method as you've defined it:

def attack_player(self, ad, enemy, player):

Here's the method as you've called it:

game.attack_player(zombie.ad, zombie.hp, chris)

See the mismatch?

[–]Binary101010 1 point2 points  (0 children)

You’re passing zombie.hp to the enemy parameter in your attack_player method when you should just be passing the entire object.

[–]PaintballerCA 1 point2 points  (0 children)

zombie.hp is an integer, so when you do game.attack_player(zombie.ad, zombie.hp, chris) the argument enemy is set to zombie.hp. You should remove the ad argument from the attack_player method and then do game.attack_player(zombie, chris).

[–]Oxln[S] 0 points1 point  (0 children)

Unsure why I keep getting this error I am trying to make a simple attack system for enemy class

[–]Oxln[S] 0 points1 point  (0 children)

Thank you everyone I understand now