The student has two characters: MainCharacter coming from the right, and Knifeman on the left.
As user presses a key, MainCharacter moves left.
The idea is that when MainCharacter reaches Knifeman’s X location (x=70), Knifeman dies and is replaced by DeadGuy.
We tried:
1 - If keydown, MC moves left…AND…if MC’s x-location = 70…then Knifeman.visible = False…AND DeadGuy.visible = True. Didn’t work.
2 - Student tried putting one or more code elements oustide the draw function. If outside, one thing happened that he wanted (Knifeman died, I think). If inside Draw, another thing happened. We couldn’t get it all to wok either inside or outside Draw.
Any ideas re: what the student might do?
Thank you very much.
Gary
Link to the project or level: [replace with link to the curriculum or get the “Share” link to a project]
What I expect to happen: [replace with a detailed description of the behavior you’re trying to create]
What actually happens: [replace with a detailed description of what actually happens when the code runs including any errors or unexpected behavior]
What I’ve tried: [replace with a detailed description of what you’ve already tried to do to solve the problem]