This here is my first time making a map tile collission function for 2D platformers.
My goal is to make a set of collission functions robust enough that I won't have to make new code ever again. Foolish as this may be it's a good exercise.
This version (v0.1.1) features speed-proofed collissions with solid terrain via map tiles, using flags 0 to 4 to indicate the size of the collission.
Feel free to use any parts of my code you fins useful. Making collission code is horrible and if I save someone else from having to make their own that'd be fantastic.
I have tried to comment the code thoroughly.
Please do contact me if you have any issues, doubts, criticisms, or advice.
In the future I intend to add semi-solid platforms, code for collissions between non-map-tile entities, code for standing on and being carried by moving platforms, and possibly even slopes and water or quicksand-like terrain. But for now, simple solid terrain of full and partial tiles works, and I am very happy with that.
[Please log in to post a comment]