Platformer Engine

Publicado 2023-06-12

As Platformers seems to be on the tips and brains of people, I remember someone once mentioned it was difficult to make a platformer. If you have a reasonable background in math, I think it can be done fairly easily.

Here then is my sample engine to demonstrate how it can be done. I have geared this particular engine to match as closely as I can Nintendo's own Super Mario Bros game without using look-up tables.


Keys are LEFT, RIGHT, and (O) to jump.

Note also I am multiplying everything by 100. The reason is simple. Most programming languages start to give incorrect values even doing simple things like subtracting .1 or .05 from a real number. By keeping everything integer, you do not have problems with the limitations of the language's inability to handle real numbers.

From here also it should be possible to make a simple platformer that detects walls, surfaces, and even allow the famous Wall-Jump where you jump from wall to wall to climb an area.

HOPE THIS HELPS !