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
// LOOPING
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.
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:
https://studio.code.org/s/csd3-2019/stage/15/puzzle/11
There is an exemplar on the right side teacher’s panel to show how to solve it, but the basic pseudocode is:
- 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).
- If the frog is on the ground, AND if the up key is pressed, change his velocity (- number).
- Once he reaches a certain point in the sky, reverse his velocity (+ number)
- 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!
Mike
Thank you! I will check it out!