So here is the deal. I've been working on and off on my little platformer and im at the point forI'm implementing collision detection with the map for my platformer. I have a method that generates a polygon on every tile and checks if the player hits it it's-- that's all fine there. But theThe problem is that when ever a player touches a wall in front of him the Dd key wichwhich moves him to the front gets disabled so he can't walk any further that way. this
This method works great for preventing him to walkfrom walking into walls, but iI also want him to be able to jump on the walls and there is the problem. So he falls on the tile(polygon) the game senses that and applies the same method for the dd key thus, preventing the character to walkfrom walking left or right, because the game thinks it is hitting the tile in the front but iit is hitting from above (i'm sorry a little vague i'm not good at english).
Long story short, the gamesgame handles collision from the top theabove same as collisions from the front or back because i don't have an idea how to make a method that would. How do I make it able to recognizerecognise collisions from the top or side. i hope you guys can help if further explantion is needed please ask. Thank you! separately from above?
This is myMy code i don't have directly acces to it but it is along thethese lines of this:
if(PlayerPolygon.interesects(TiledPolygon) && dKey==1) { moveX = 0; } if(dKey==1) { player.x +=moveX }