How to do pixel-perfect collision detection of a player and the walls (JavaScript Game)
问题 I'm making a 2D game in JavaScript. For it, I need to be able to "perfectly" check collision between my players(the game has two players, open the picture please) and the walls! I mean, I have a function that actually works, but when I make them jump against the walls they pass through the walls and keep moving until they reach another area or even leave the canvas! Also, if they are falling down and I make them collide with a wall, they just stop there wich is also pretty bad! I really need