Unit 3, Lesson 15



When working with puzzle 11 and the frog velocity coding, my students unable to get the frog to stop moving, even with frog.velocityY = 0 set in the else portion of the if statement.

Is this a glitch? all the other code works fine.



Can you give an example by clicking the “Share” button on one of the levels where this is happening and pasting the link here?





The frog jumping appears to be working on this one. The only issue I see is that the mushroom isn’t moving because its position isn’t being changed with the counter pattern.


The directions say to make the frog jump when the up key is pushed and then stop. the velocityY = 0 isn’t working to make the frog stop. or is that not the intent?


It makes the frog stop when it is back on the ground. Without that line of code, the frog would fall through the ground off the screen.

So, if the frog is on the ground, two things could possibly happen.

  1. If the up key is pressed, it starts to move up.
  2. Else, it stops where it is.