Trying to figure out collision with tiles in platformer game
Posted: Sun Feb 18, 2024 11:32 pm
Hello! I am new to Love2d and trying to make my first little platformer game.
I am trying to keep it somewhat simple so I am avoiding advanced 3rd party libraries and such for now to get a better basic understanding of concepts and such.
I figured I start with a 2d platformer and it is going well thus far. I have a player running and jumping around using x, y positions with velocities for both axises as well. Currently I have randomly generated tiles that I store in a table and draw onto the game canvas.
Now I am curious how I can get my player to collide with the tiles and stop moving. Most of what I can find seem to use physics libraries for this which I am trying to avoid for now.
I did find some things, like AABB collision detection. Though I am not certain what to do once I have detected a collision as I cannot seem to figure out how to push the player in the correct direction after intersecting a tile.
Does anyone have any good ideas/tips for me here?
I am trying to keep it somewhat simple so I am avoiding advanced 3rd party libraries and such for now to get a better basic understanding of concepts and such.
I figured I start with a 2d platformer and it is going well thus far. I have a player running and jumping around using x, y positions with velocities for both axises as well. Currently I have randomly generated tiles that I store in a table and draw onto the game canvas.
Now I am curious how I can get my player to collide with the tiles and stop moving. Most of what I can find seem to use physics libraries for this which I am trying to avoid for now.
I did find some things, like AABB collision detection. Though I am not certain what to do once I have detected a collision as I cannot seem to figure out how to push the player in the correct direction after intersecting a tile.
Does anyone have any good ideas/tips for me here?