How to make bounces in Hopscotch?



Hey guys. I'm wondering if anyone knows how to create bouncing in Hopscotch. I need it for a game mechanic. Different kinds, such as a bouncy ball, trampoline, etc. would be helpful. And I don't mean set, unrealistic Change Y by blocks.

Is there a formula or something that creates realistic bouncing? Thanks!


First do when Play button is tapped, then take out a (repeat forever), then take (change y by Gravity), then ,make a new value called gravity. Then take out a (increase Gravity by 1). Make a new rule when . bumps edge, then take out a set value block; (Gravity) to (what ever you want). Now you are done! I may make a video for this on my youtube channel Phase Studios(Hopscotch the App).


Hi @CreativeCoder good question! I've wondered how to make bounce too. I learnt from a great tutorial by @Funky_63_Greenland and here it is:

So like @Phase_Studios said, you can call the value "Gravity".

At the start, set Gravity to 0.

Repeat forever 
    Increase "Gravity" by -1 
    Change Y by "Gravity"

(in the picture it says repeat 99999 because there weren't any repeat forever blocks at the time, and the Increase Value block used to be called Change Value).

And when you want your object to bounce, add the code:

Set value "Gravity" to 25

So what the code is doing in the repeat forever is making gravity lower and lower, so the object changes Y lower and lower.

But when you make the value Gravity equal 25, the object will change Y by 25 and move up instead and it will bounce up. Then 25 will get smaller and smaller until it is negative because of the Increase Gravity by -1, and when it's negative that's when the object falls down again because then it will start changing Y by a negative number.

Hope this helps and feel free to ask for more clarification :smiley:

How do you make a simple platform game?

Thanks @Phase_Studios and @t1_hopscotch! I'll be sure to credit you in the game!


@CreativeCoder, how do you do the button thing? Please don't flag this.


You can use the code [kbd]something[/kbd]


[kbd]It doesn't work for me?[/kbd]


Sorry, it's < and > not [ and ]


Thank You so much @CreativeCoder!


You're welcome @CreativeCoder!