Unit 3, Lesson 15

csdunit3

#1

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.


#2

Hi!

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

Elizabeth


#3

https://studio.code.org/projects/gamelab/l87jIV_S0m9YDyG6ClUZcJcLojLH4igN2QFTunLC13k


#4

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.


#5

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?


#6

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.