Heron Posted May 2, 2016 Share Posted May 2, 2016 I Need help, i have a bug in my game, i use P2JS physics but i have a bug in collisions se the video to see :/, video and sources are attached thank you! video.webm Game.js players.js Link to comment Share on other sites More sharing options...
Cudabear Posted May 3, 2016 Share Posted May 3, 2016 Hi, So the problem is you are moving sprites around by manipulating their X and Y coordinates directly, which physics don't like. If you move a collision box into another one, it attempts to solve to collision but because the velocity of the colliding box is 0, it doesn't make it easy to solve. That's why you're seeing this kind of strange behavior. You should be manipulating the player's body velocity instead of X and Y directly. You probably don't want to reset the player's velocity each tick, as well. Heron 1 Link to comment Share on other sites More sharing options...
Heron Posted May 4, 2016 Author Share Posted May 4, 2016 okay thx Link to comment Share on other sites More sharing options...
Recommended Posts