# Unit 3, Lesson 15

**URL:** <https://forum.code.org/t/unit-3-lesson-15/22417>\
**Category:** Unit and Lesson Discussion\
**Tags:** csd-unit-3, csd-unit-3-lesson-15\
**Created:** [November 20, 2018, 8:30pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417 "2018-11-20T20:30:20Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![leinerj](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@leinerj](https://forum.code.org/u/leinerj)\
**Post date:** [November 20, 2018, 8:30pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/1 "2018-11-20T20:30:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [November 20, 2018, 9:45pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/2 "2018-11-20T21:45:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![leinerj](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@leinerj](https://forum.code.org/u/leinerj)\
**Post date:** [November 21, 2018, 11:51am UTC](https://forum.code.org/t/unit-3-lesson-15/22417/3 "2018-11-21T11:51:19Z")

</div>

[https://studio.code.org/projects/gamelab/l87jIV\_S0m9YDyG6ClUZcJcLojLH4igN2QFTunLC13k](https://studio.code.org/projects/gamelab/l87jIV_S0m9YDyG6ClUZcJcLojLH4igN2QFTunLC13k)

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [November 21, 2018, 7:50pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/4 "2018-11-21T19:50:26Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![leinerj](https://avatars.discourse-cdn.com/v4/letter/l/94ad74/32.png) [@leinerj](https://forum.code.org/u/leinerj)\
**Post date:** [November 21, 2018, 8:02pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/5 "2018-11-21T20:02:36Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [November 21, 2018, 9:39pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/6 "2018-11-21T21:39:11Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [December 14, 2018, 10:31pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/7 "2018-12-14T22:31:27Z")

</div>

A post was merged into an existing topic: [Code not running in blocks view, but will run after pressing show text](https://forum.code.org/t/code-not-running-in-blocks-view-but-will-run-after-pressing-show-text/11326/8)

---

<div class="post-metadata">

**Author:** ![Matt\_Rowland](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/matt_rowland/32/881_2.png) [@Matt\_Rowland](https://forum.code.org/u/Matt_Rowland)\
**Post date:** [January 9, 2019, 6:12pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/8 "2019-01-09T18:12:54Z")

</div>

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](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/e/eddd39b2ca79da39f07caf9d1f6eeacbcd868559.png)

---

<div class="post-metadata">

**Author:** ![elizabeth\_admin](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@elizabeth\_admin](https://forum.code.org/u/elizabeth_admin)\
**Post date:** [January 9, 2019, 10:22pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/9 "2019-01-09T22:22:31Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rschaeffer](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/rschaeffer/32/2175_2.png) [@rschaeffer](https://forum.code.org/u/rschaeffer)\
**Post date:** [March 7, 2019, 10:30pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/10 "2019-03-07T22:30:41Z")

</div>

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](https://us1.discourse-cdn.com/flex016/uploads/codeorgforum/original/2X/4/4e289de408b899ed492025aa3606a7c8d1fa9dac.png)

---

<div class="post-metadata">

**Author:** ![karenma](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/karenma/32/4924_2.png) [@karenma](https://forum.code.org/u/karenma)\
**Post date:** [March 8, 2019, 3:31am UTC](https://forum.code.org/t/unit-3-lesson-15/22417/11 "2019-03-08T03:31:27Z")

</div>

Hi Ron,

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

Karen

---

<div class="post-metadata">

**Author:** ![abi62176](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/abi62176/32/9233_2.png) [@abi62176](https://forum.code.org/u/abi62176)\
**Post date:** [April 3, 2019, 11:15pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/12 "2019-04-03T23:15:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rebecca.sims](https://avatars.discourse-cdn.com/v4/letter/r/dec6dc/32.png) [@rebecca.sims](https://forum.code.org/u/rebecca.sims)\
**Post date:** [September 16, 2019, 11:35am UTC](https://forum.code.org/t/unit-3-lesson-15/22417/13 "2019-09-16T11:35:03Z")

</div>

I thought I was missing something. Been working on trying to get the frog to stop for about 15 minutes now…

---

<div class="post-metadata">

**Author:** ![kathy.mcdaniel](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kathy.mcdaniel](https://forum.code.org/u/kathy.mcdaniel)\
**Post date:** [November 19, 2019, 2:14pm UTC](https://forum.code.org/t/unit-3-lesson-15/22417/16 "2019-11-19T14:14:34Z")

</div>

What if the frog begins to come down sooner than \<30 like this  
// if the frog gets high enough  
// send it back down  
if (frog.y \< 225) {  
frog.velocityY = 1;  
}

that would give it enough room to get over the mushroom so it can come down sooner and jump the mushroom again. Just a thought I had and it seems to work.
