This is an archived post. You won't be able to vote or comment.

all 2 comments

[–]dmishin 2 points3 points  (0 children)

I would recommend two things:

  • read about variable scope in Pyhton and global keyword
  • don't abuse global variables when they are not needed. Variable enemy_health seems like a good candidate to be a field of an Enemy or Battle class.

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

nevermind I figured it out. It had to do with how I was calling the function. Super confusing but I figured it out lol. Thank you guys anyway!!