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.
This is basically a half-assed demake of Wingnuts tmporal navigator, and my first time coding ever. YIPPIEEE!
(The time I did the first steps to a javascript course on codecamp does not count ahahaheh)
If you look at my code you will find Some Horrors Indeed. Once I figured out how to have multiple bullets exist at once I went "okay let's try to make everything else with just what I now know" as a personal challenge.
I was advised to use voids, inverse functions for sin and cos, atan... and I am sure all of those suggestions were good, but I wanted to figure out if I could get enemies to target me without any of that.
The result is code that works well enough and I don't wanna look at ever again in my life, WOOHOO! I'll take it for my first project eheheh.







0 comments