I finished the code.
On the left is the final fruit of my efforts. Yeah, it vibrates at the end. I assure you this is entirely impossible to stop, and honestly, I doubt that a bouncing ball has much use in videogame design anyway, unless you're doing something that specifically requires a bouncing ball.
The second one stops when it hits the ground, like a character in a game might.
The code was vastly overhauled from the previous version, which, despite having no air resistance coded in, somehow bounced lower and lower each time. After a bit of experimentation I managed to get it bouncing back up to the same exact height every time. Like a ball in a vacuum. From there I added in air resistance by multiplying velocity by .98 every frame.
Comments
AeroSky Says:
Boing.
Zielak Says:
it's still bouncing, lol.
sherbear Says:
It looks like sperms