Questions tagged [box2d]
Box2D is an open-source rigid-body 2D physics simulation library for games, written in C++, with ports in various languages
821 questions
1 vote
1 answer
104 views
Objects move with different speed on different devices
I was making a 2d top-down game, but when I tested it on two devices (Samsung M31 and Samsung S25) there was a problem with player speed - it was faster on S25 and slower on M31. I tried using some ...
0 votes
1 answer
106 views
How to drag existing body to another position?
I have a game object with a Kinematic body and a sprite. The object's "draw" method will always position the sprite to match a position of actual body, so the sprite is completely passive. ...
0 votes
0 answers
73 views
How to Simulate Natural Falling Behavior for Stacked Shapes?
There is a thin, long rectangle placed slightly below a circle, and I let them fall simultaneously. When they hit the ground, they land perfectly aligned, one on top of the other. In the real world, ...
0 votes
1 answer
85 views
How to destroy/remove Texture after collision in java box2d
I'm coding a simple Arkanoid/Breakout game and have problems with removing the bricks. I'm able to destroy the body but the texture is still there. I'm a beginner so is there a simple way to remove it ...
0 votes
1 answer
88 views
Connecting bodies together in jbox2d
Im trying to connect bodies together to make some sort of a "building" system or more specifically im trying to make multiple "blocks" connect to eachother but Struggling to figure ...
0 votes
1 answer
110 views
How to make a ball always bounce like in the game One More Bounce using Box2D?
I'm coding a game with Flutter and the flame_forge2d package (which uses Box2D internally). I want to make a game whose principle is similar to that of the game One More Bounce (a game where you have ...
3 votes
1 answer
179 views
Character overlaps with static objects
I am creating a simple OpenGL C++ game. I have a main character (green box) and some static objects (red boxes) positioned as stairs. The problem is as green box is descending down the stairs, it ...
1 vote
0 answers
87 views
Trying to plot trajectory of rocket using only its current position and velocity components
I have a 2D controllable rocket for which I want to plot the parabolic motion. Additionally, the parabola should be able to change due to the thrust of the rocket accelerating it in either direction. ...