# Unit 3 Lesson 20 Bubble 2

**URL:** <https://forum.code.org/t/unit-3-lesson-20-bubble-2/36161>\
**Category:** Coding and Debugging Help\
**Created:** [April 12, 2022, 9:09pm UTC](https://forum.code.org/t/unit-3-lesson-20-bubble-2/36161 "2022-04-12T21:09:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![gellis1](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gellis1](https://forum.code.org/u/gellis1)\
**Post date:** [April 12, 2022, 9:09pm UTC](https://forum.code.org/t/unit-3-lesson-20-bubble-2/36161/1 "2022-04-12T21:09:47Z")

</div>

> **[Check out what I made](https://studio.code.org/projects/gamelab/PnKVxStAnUQ9Zs7ZoFnYA4dduER38h3L4aplHhnklU8)**
>
> I wrote the code myself with Code.org

Two problems:

1 - student wants sprite to go up (all the way) when she presses the key. She has instructions for the sprite to descend at Y=100. When the sprite descends, the sprite goes past Y=400. I inserted the code about stopping the sprite at Y= 360, but I’m not sure if that was the most efficient way of doing it (wondering if I needed to nest IF statements).

2 - Code works on my computer, but not when students runs it. We’re confused.

Thank you!

Gary

1. 

**Link to the project or level:** [replace with link to the curriculum or get the “Share” link to a project]  
**What I expect to happen:** [replace with a detailed description of the behavior you’re trying to create]  
**What actually happens:** [replace with a detailed description of what actually happens when the code runs including any errors or unexpected behavior]  
**What I’ve tried:** [replace with a detailed description of what you’ve already tried to do to solve the problem]

---

<div class="post-metadata">

**Author:** ![CeciliaZ](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.code.org/ceciliaz/32/7000_2.png) [@CeciliaZ](https://forum.code.org/u/CeciliaZ)\
**Post date:** [April 13, 2022, 12:30am UTC](https://forum.code.org/t/unit-3-lesson-20-bubble-2/36161/2 "2022-04-13T00:30:30Z")

</div>

I think you answered your question about why the sprite doesn’t go all the way up - because the student has code for it to descend when frog.y is less than 100. It goes as high as frog.y being 100 and then the velocity is changed and it descends. Have you tried changing the number in the “If frog.y \<100” statement?

It worked on my computer too. I’m not sure why it would work on one computer and not another, unless the code wasn’t changed. If that continues to be a problem just on that student’s account/computer that would be a question for [support@code.org](mailto:support@code.org)

Often there is more than one way to solve a problem in coding. You did it, you solved it and it worked the way you wanted it to. Problem solved 🙂

---

<div class="post-metadata">

**Author:** ![gellis1](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@gellis1](https://forum.code.org/u/gellis1)\
**Post date:** [April 13, 2022, 8:34pm UTC](https://forum.code.org/t/unit-3-lesson-20-bubble-2/36161/3 "2022-04-13T20:34:19Z")

</div>

Thank you very much - as it happened, it worked on the student’s computer today!

Gary
