CSD Unit 3, Lesson 17 Bubble 5

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.


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]


It looks like sharing might not be enabled for this project. Can you either enable sharing or remix it yourself and send a new link? We’d be happy to look at it if you can do that!



Thank you very much. I’ve just enabled sharing!

First, this kid is just funny!! I love the illustrations and the dark humor in it! Second, I think it might be working now. I used the ‘w’ key and took the MainCharacter to the left and Knifeman turned to Deadman. Then I used the ‘d’ key and moved MainCharacter to the right until he got to the house. It changed to BadHouse. What it supposed to do something else or did the student just get it figured out?