Unit 3 Lesson 15 - Frog won't stop going up

My student (same as in Lesson 14) is trying to move ahead to lesson 15 - He sets velocity to 0 in the else statement, but the frog continues to move up:

I’ve tried different velocities, but nothing changes.

Hello, @jo.french,

I understand the frustration on this lesson. It can be a little confusing, but the velocity in the else statement tells the frog to stay on the ground (ie. don’t move at all) if the up key isn’t pressed, so that statement is actually doing what it is supposed to.

If you continue in the code, you will see a section where blocks need to be added to tell the frog what to do if he gets too high (if the y value is too low) on the screen.

So, if you add a conditional block on line 29 you should be able to tell the frog to change velocityY to a positive number if his y position is too high (thus causing him to go down).

Give it a shot and let us know how it goes!

Mike

Thank you! I was interpreting the command as KeyDown instead of KeyWentDown, so that the frog would stop when you release the up key. As I tell my students, it always helps to get another set of eyes!