Arduboy Trampoline Demo

Trampoline-Demo.ino-arduboy.hex (29.0 KB)

This is a little trampoline demo I put together in a few days to get me back into the Arduboy workspace and get me used to physics. It’s semi-accurate (minus a few forces and whatnot) to what you would see if you dropped a ball on the trampoline (a ball is the simplest because of the lack of edges and vertices).


B: Change the mode from preview to simulation and vice versa
Up/Down: Change the value of gravity
Right/Left: Change the value of restitution (don’t know if it should be labeled as negative restitution, but it works)
A + Up/Down: Change the height of the ball


Preview: A mode with no physics, for changing values
Simulation: A mode with physics, for simulation, cannot change values (although that might change in the future)

If you see an asterisk beside a value, it means the “default value” (or what I think is a good default value). I also don’t know if the emulator is completely accurate to what it is on hardware, but looks good to me.

  • Changed cutOffPoint (formerly cutOffAmmount) to 0.5 for more natural “micro-bounces.”

It also just occurred to me that the values can go negative, so that opens up more wacky fun.
Source code as well as a compiled hex can be found below:


It’s not entirely accurate, but being completely accurate with physics generally isn’t worth the effort.

That’s even more true for a platform with such limited resources as Arduboy:
you can be very accurate for a small number of objects or roughly accurate for a lot more objects.

1 Like