I am using Box2D for my physics and I am having trouble my player clipping into the walls and getting stuck in mid air, I am trying to simulate zero gravity in my game or at least an underwater feel so I'm not sure if that could be the cause
The controls are the standard "WASD"
I also have trouble getting the player to appear clearer after scaling it up
I'm having problems with collisions in my game
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
I'm having problems with collisions in my game
- Attachments
-
- Game.love
- (13.66 KiB) Downloaded 40 times
Re: I'm having problems with collisions in my game
For the scaling problem (assuming you're using pixel-art) use
For the collision problem, I recommend just switching to something simpler like bump. It is fast, comes with several ways to handle resolution, and is generally good for axis-aligned platformers like yours.
If you want to stick with Box2D, please provide a snippet of your collision code.
Code: Select all
love.graphics.setDefaultFilter('nearest', 'nearest')
If you want to stick with Box2D, please provide a snippet of your collision code.
Re: I'm having problems with collisions in my game
the body might get stuck because it rotates when sliding along the walls and corner.
you only use its x,y position for drawing but not the rotation angle.
so your graphics and the physics body are not fully in sync.
there is a function to set fixed rotation, try that.
you only use its x,y position for drawing but not the rotation angle.
so your graphics and the physics body are not fully in sync.
there is a function to set fixed rotation, try that.
Who is online
Users browsing this forum: Ahrefs [Bot] and 4 guests