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.

split this topic #7

A post was merged into an existing topic: Code not running in blocks view, but will run after pressing show text


I am experiencing the same issue with lesson 15 level 13. I suspect that it is a bug of some kind. Can I get some clarification? The directions clearly state that if the up key in no longer being pressed then the frog should stop moving. However, using frog.velocityY=0 as the then statement has no effect. I have used multiple browsers. Can you explain if this is working as designed and why the sprite does not stop going up after the key is no longer being pressed?


The frog should only stop if it is on the ground. The nested conditional means that two conditions have to be true for the frog to stop from the code on line 25. First, the frog must be on the ground (y position greater than 324). Second, the up key should not have gone down. If the frog is in the air, this condition is not triggered and it does not stop.