Made a sample platformer, mostly to show how to do things like collisions, camera, jump buffering, and slopes. I wrote this to be clear rather than to save tokens, and it has no real gameplay to keep the core of the engine as clear as possible.
The code for this cart can also be found on github and is MIT licensed.
Features:
- Movement and jumping
- Collision checking and resolution
- Jump buffering
- Slopes
- Platforming camera
Your camera is good. The ability to not track the vertical camera until the player has landed on an upper or lower solid surface is the right way to do it.
You might add a 45-degree angle slope where the player slides down with gravity.
This is a great reference. Code is really readable which is key.
Also had never thought about the camera tracking thing - something else learned!
[Please log in to post a comment]