Local variable definitions do not transfer from one function to the next. You’ve defined coin in your onSpawn() function but not in your while True loop. When the code gets to the conditional, if hero.coin > 300:, it has no idea what coin is.
hero.coin should be hero.gold
Regarding the first screenshot, what’s on the first 28 lines?
I still don’t understand.
The first screenshot starts at line 29. What is before it? Line 1 through 28.
I try but still don’t working
What’s not working? All I’m asking you to do is scroll up and take another screenshot.
The screenshot was not mine just now.
That’ok . Could you help me with this code?
have you made the changes suggested above?
I don’t know how to define the coins owned by hero. is hero.gold? i have tried. but…
Using the code posted in your screenshot, just make the change suggested by kyay10 in your while True loop.
my code. (Don’t want to give away solution)
I used Nalfar for this level
My okar once started spawning skeletons and scattershoting enemies.