Help! My side scroller game has a bug! (or two)

Can anyone view my code and tell me why my tapir won’t come back down after the up arrow is placed? I have been working on it all week and still can’t figure it out.

You forgot to finish it!

  // if the tapir reaches the top of the jump
  //go back down


There is some code missing.

Sorry I had the wrong version. I have that piece of code added, and the tapir still hangs out in the sky. - Game Lab


Did you figure it out? It appears to work for me when I check it right now.


One of my students got the animal to come back down, now he kind of comes down too far, but it’s a lot better now.

If you have a verified teacher’s account, you could check out this activity from last year’s version of the curriculum:

There is an exemplar on the right side teacher’s panel to show how to solve it, but the basic pseudocode is:

  1. Check to see if the frog is on the ground. If he is, set his velocity to 0 (he won’t move if on the ground).
  2. If the frog is on the ground, AND if the up key is pressed, change his velocity (- number).
  3. Once he reaches a certain point in the sky, reverse his velocity (+ number)
  4. Once he reaches the ground again, the 1st rule above will set the velocity to 0 and he will stop moving.

Hope this helps a bit!


Thank you! I will check it out!