A way to make a sprite bounce?

csd-unit-3-lesson-9
#1

Anybody have any idea if there is a way you could make a sprite look like it was bouncing. A student was creating a scene with a bunny and she wanted it to bounce. We tried to play around with x and y but nothing could quite get us there. I am assuming maybe once they have booleans and stuff it may be possible?

#2

Ben,

Just a clarifying question - you would want the first “bounce” to be higher/highest and then each “bounce” afterwards be lower until the bunny rest on the ground? Off the top of my head you could have a variable (“bounce”) that would be equal to the y value and would decrease according to how many time the bunny has touched the ground sprite. You’ll get into this a little bit in Chapter 2 of Unit 3, but the decreasing height on each bounce isn’t taught.

Let me know if you have further questions / if it works!

Brad