Simple Physics going crazy

lucario888

  • Posts: 38
Ok, so for some reason collisions don't seem to occur properly when "Simple Physics" mode in the advanced configurations tab is turned on. Its best explained by the pictures attached to this post. Sure, I could just turn on "Box2D" and fix this right away but the framerate would take a huge hit rendering the game almost unplayable. Any help would be greatly appreciated!

Thanks,
Me

« Last Edit: November 21, 2017, 04:17:43 pm by lucario888 »

JeffreyDriver

  • Posts: 2262
Are your collision shapes just boxes? (Not circles or polygons)

Also, using Box2D shouldn't cause you problems. It sounds like there might be issues with your game setup, and things need optimizing. Lag with Box2D is usually caused by many simultaneous collisions.

First of all, go through all your actors and decide if they need collision shapes or not. For example, if your heart icons have collision shapes, do they need them?

A useful technique to adopt is using maths to determine collisions by calculating the distance between two actors, rather than using collision shapes.

lucario888

  • Posts: 38
There's no way the Box2D stuff is lagging behind. There's barely anything going on in the screen. At the times of those screenshots, the hearts had no collision box neither the tiles behind them. The game algo goes at full 60 fps too. And yes, all the hitboxes were just rectangles, nothing advanced

That advanced tab I was talking about was the global settings for the whole game, not just for individual actors. And for that reason, the "Enable Debug drawing" option doesnt do anything at all.

JeffreyDriver

  • Posts: 2262
In your first post you said that using Box2D caused your game to lag/framerate to drop?

Enable Debug Drawing will only work if Box2D is enabled.