Lab: Collision

Build this on top of your 2D game engine, or the beginning of the fancy sprites lab.

Implement a tiny platformer game where you can jump on stuff and bump into things. In a world with a downwards acceleration due to gravity, jumping could mean setting an upwards velocity; typical tricks here are to maintain a constant upwards velocity while the button is held down (like a jetpack, often only up to a certain maximum duration of a few fractions of a second) or increase effective gravity after the apex of the jump.

For full points, do one of the following:

Efficiency tip: You will need to track a Vec of contacts every frame. It would be a good idea to have one vec which you clear and fill up again every frame rather than creating a new Vec every frame.