Unit 3, Lesson 15

csd-unit-3
csd-unit-3-lesson-15
#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.

0 Likes

#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

0 Likes

#3

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

0 Likes

#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.

0 Likes

#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?

0 Likes

#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.
1 Like

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

0 Likes

#8

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?
21%20AM

1 Like

#9

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.

0 Likes

#10

The Instructions are confusing. The 2nd bullet under the 1st bullet reads in such a way that you would think that the frog should stop when the up arrow is released.

" Make the frog jump up when the user presses the arrow key.
" Make the frog stop moving otherwise."

Clearly the nested loop will not allow this once the sprite begins moving.

Perhaps additional instructions would help clear the confusion

11

1 Like

#11

Hi Ron,

Thank you for the suggestion. I have forwarded this to the curriculum team.

Karen

0 Likes

#12

I have the same problem. I am glad that I am not the first one to think that the frog stops when velocityX=0; Anyways, I agree that the instructions are little confusing. If I was a student I would be stuck on the 1st bullet and not move forward with out realizing this if condition is going to come into picture on the 2nd bullet. Thanks for sharing with curriculum team.

0 Likes