Box2D is an open-source rigid-body 2D physics simulation library for games, written in C++.
5
votes
1answer
644 views
Scrolling Box2D DebugDraw
I'm developing a game using Box2D (javascript implementation - Box2DWeb), and I would like to know how I can pan the debug draw. I know the usual answer is - don't use debug draw, it's just for ...
2
votes
1answer
97 views
Separation algorithm in flock simulation?
I'm using box2d (the c++ one).
I found a method for an arriving behavior (on http://www.red3d.com/cwr/steer/gdc99/ ), which works well, problem is, the bodies are bumping into each other and it ...
2
votes
1answer
66 views
Bodies do not stay sticked together by joint in retina display
I'm rehearsing on Box2D revolute joints. Everything's going pretty well except for one thing. For some reason bodies joined together with revolute joints do not stay sticked, they start getting apart ...
2
votes
1answer
176 views
AndEngine; Box2D - high speed body overlapping, prismatic joints
I'm trying to make good suspension for my car game, but I'm getting nervous of some problems with it.
At the beginning, I've tried to make it out of one prismatic joint/revolute joint per one wheel ...
1
vote
1answer
147 views
Understanding Box2d Restitution & Bouncing
I'm currently trying to implement basketball bouncing into my game using Box2d (jBox2d technically), but I'm a bit confused about restitution.
While trying to create the ball in the testbed first, ...
0
votes
1answer
120 views
Is there a “box2d without physics” lib (only for collision detection)?
Box2d Collision detection algorithms are probably the best ones out there. Unfortunately, they are bundled together with a realistic physics engine that I don't need.
Is there an open source project ...
0
votes
1answer
110 views
Libgdx import bin/xml/json from physics editor
I'm using Libgdx. I did a simple json file in Physics Body Editor and I don't have any idea how could I import it into my physic world in libgdx.
Any idea will be appreciated.
P.S: Sorry if there ...
0
votes
1answer
363 views
Store and create game objects at positions along terrain
I have a circular character that rolls down terrain like that shown in the picture below.
The terrain is created from an array holding 1000 points. The ground is drawn one screen width infront and ...
6
votes
0answers
118 views
How do I get the compression on specific dynamic body
Sorry, I could not find any tag that would suit my question.
Let me first show you the image and then write what I want to do:
I'm using box2D. As you can see there are three dynamic bodies ...
2
votes
0answers
117 views
Letting the user draw a Polygon Body and Image
In my game, I want to provide the user with a drawing feature.
By free hand drawing, the user creates a polygon shape. Then, in my game implementation, I have to create a body for the found vertices ...
2
votes
0answers
190 views
Error in destroying object in Box2D/LibGDX
I'm trying to delete an object when a collision happens. I have put the following code in the render method of the object so it would be outside of the physics calculations.
public void ...
2
votes
0answers
246 views
Box2d based tile map game scrolling problem
I am using a tile based game and also used a joystick. Using joystick sprite body move perfectly but tile map can not scroll.
-(void)setCenterOfScreen:(b2Vec2)position
{
int ...
2
votes
0answers
212 views
how to attach a body to a rope and making it swing to another rope
I've set some ropes (using cocos2d and box2d) and would like to attach a body to one rope in such a way that it can swing to another rope. I am not sure how to go about this. I read making and object ...
2
votes
0answers
320 views
box2d reset position of falling object not behaving properly
I have been playing with box2d in libgdx and have made a falling ball.
Once the ball lands on the ground I want to be able to reset it to the top with the space-bar key
I have done this:
if ...
1
vote
0answers
77 views
Box2D, OpenGL, resolution and matrix setup
Okay, my internal units are going to be meters, ranging between 0.1 and 10 meters for size.
First of all, my mind is all wrapped up in a knot trying to understand how to handle my game with multiple ...
1
vote
0answers
110 views
Flick Kick like game with box2d and flash as3
What would be the best approach for creating a game like flick kick with box2d and AS3?.
To make my self more clear, what i would like to do is to use the physics of box2d in the z-axis, i know that ...
1
vote
0answers
230 views
AndEngine Box2d game
I'm developing a 2d survival shooter using Box2d extension and I've got some questions:
I have two AnalogOnScreenControls. Their listeners modify both
sprites and bodies. I receive TouchEventPool ...
1
vote
0answers
187 views
Wheel Joint Implementation in AndEngine
I am currently developing car game in AndEngine. In which I was using revolute joint for car wheel and chassis attachment. But my friend suggest me that use wheel joint for that purpose for better ...
1
vote
0answers
354 views
Split Body and Sprite
I want to split the body and sprite into multiple pieces as like following link suggest:
http://www.raywenderlich.com/14302/how-to-make-a-game-like-fruit-ninja-with-box2d-and-cocos2d-part-1
I try to ...
1
vote
0answers
238 views
Box2D Bicycle Wheels Motor Problem - Flash 2.1a
I have made a bicycle with Box2D using several polygons for the frame at different angles connected using weld joints, and I have revolute joints on the wheels with a motor.
I have made some basic ...
1
vote
0answers
212 views
changing body type without change of center of mass
I have an box2d project with some bodies in it, which move around without any user interaction. But if the user selects one of the bodies, he should be able to move it around just like he wants to.
...
1
vote
0answers
572 views
How to properly add texture to multi-fixture/shape b2Body
Hello to everyone this is my first poste here I hope that will be not fail start.
At start I must say I make part 1 in Ray's Tutorial "How To Make A Game Like Fruit Ninja With Box2D and Cocos2D". But ...
1
vote
0answers
206 views
Design pattern for procedural terrain assets
I'm developing a procedural terrain class at the moment and am stuck on the correct design pattern. The terrain is 2D and is constructed from a series of (x,y) points. I currently have a method that ...
1
vote
0answers
412 views
Why are my Box2D bodies disappearing when they collide?
I have a Box2D simulation going on and a system that loads the bodies and its' shapes from a text file definition.
I create a new physics world, i load bodies into it, from one of these files. ...
1
vote
0answers
155 views
Which is the best model to present the destruction of the building in Box2D?
We'd like to create a "world-destruction" game. The problem is in choosing the best model for building destruction.
On my mind the building would be an array of objects( tiles). Each object would ...
0
votes
0answers
26 views
Making Puzzle Bubble type game in AndEngine
I want to make Puzzle Bubble clone game and I need some serious help.
Can you please tell me using physics what should I start with? I mean how can I make addictive levels and How can I reflect the ...
0
votes
0answers
38 views
360 degree gravity game mechanic like “They Need To Be Fed” game
I am a fan of "They Need To Be Fed" game and I want to understand the game mechanic at a deeper level. What are some good resources for the basic Box2d (or similar) physics behind the 360 degree ...
0
votes
0answers
19 views
Weld Joint Box2d not run
i have two object like this :
b2WeldJointDef weldJoint;
//frist body
bodyDefXich.type = b2_dynamicBody;
bodyDefXich.position.Set(3, 2);
b2FixtureDef fixtureDef;
b2PolygonShape ...
0
votes
0answers
37 views
Catching an object from sky in Cocos2d and Box2d world
My world has a gravity of -9.8 and there are KDynamicBodyType bodies falling from the sky. At the bottom there is a PhysicsSprite with KinematicBodyType. I want the PhysicsSprite to be able to catch ...
0
votes
0answers
47 views
Cocos2d/Box2d Component based entity system
Recently I've read somewhere that it is not a good idea to inherit from CCSprite class when making your game objects. In my CBES each Game Object has :
-PhysicsComponent(responsible for updating ...
0
votes
0answers
102 views
Slow Rope Joint Simulation
I am right now developing game similar to Cut The Rope.
But I have some problem in developing this game.
I have successfully created rope and attached multiple rope with candy.
Below I represent ...
0
votes
0answers
45 views
GetReactionForce().y does not show 0 even it has no weight
I have built a simple structure with static and dynamic bodies and revolute joints. None of the bodies have weight, I've set the density to 0. Here's the structure:
In screen update method I do ...
0
votes
0answers
50 views
Problem with the multiple polygon collision
I have created the heart body used the physics editor and it gave me the 3 polygons.I have multiple heart bodies that are spawing. When it collide with car body my application hang after some ...
0
votes
0answers
31 views
Check duplicates in the removeList in box2d iphone
sometimes a collision is called twice in that case i need to be check duplicates from the removeList. because of this my application is getting crash or hang.
How can i check duplicates in the ...
0
votes
0answers
172 views
LibGDX Touch Box2D Body
I am using LibGDX, however, instead of using the stage, actors, etc, I wanted to use straight Box2D that way I could port it easily (to iPhone) later. I have the character moving with the ...
0
votes
0answers
104 views
How to create move button for movement of box2d body continous
I have some problem regarding movement of box2d sprite body.Problem is when i press left button than my sprite move left and when i release button my sprite will stop.
I know the logic of movement ...
0
votes
0answers
55 views
limiting a sprites movement after a mouseJoint is released
I have created a weldJoint between two sprites and I also created a method (spritePositionRelease) that returns the exact position of a sprite when a mouseJoint is released. I want to track the ...
0
votes
0answers
132 views
Farseer non-colliding bodies affect eachother
I'm trying to use Farseer to make a tile engine, but bodies that are not colliding with a sprite are still having an effect on it.
In this image there is a single sprite(the green box) and a single ...
0
votes
0answers
97 views
Using same b2World in different classes/Layers
How can we use same b2world in different classes in our game.. ? I am having two classes gameLayer and weaponLayer respectively. I am trying to use the b2world I am using in gameLayer in weaponLayer ? ...
0
votes
0answers
194 views
Box2DWeb problems
I'm having problems with box2DWeb. I can't seem to get 2 objects on the screen at once. I can get either a static body, or a dynamic one. But when trying both at the same time it messes up and just ...
0
votes
0answers
174 views
How to attach an object to a rotating circle?
I am trying to make an object get attached on a collision point to a circle that is rotating, but the player needs to get attached with a constant point on the player. For example the player is moving ...
0
votes
0answers
61 views
Creating a contact listener with sprites from different classes
I've been trying to set a contact listener that creates a joint on contact between two sprites which have their own classes. Both sprites are inheriting from NSObject and they are initialized in their ...
0
votes
0answers
2k views
LibGDX Box2D Body and Sprite AND DebugRenderer out of sync
I am having a couple issues with Box2D bodies. I have a GameObject holding a Sprite and Body. I use a ShapeRenderer to draw an outline of the Body's and Sprite's bounding boxes. I also added a ...
0
votes
0answers
545 views
Box2d : Sprite display not fit with body when rotated
I have recently achieved to render box2d Objects, and texture with sprites at where the box2d objects exists. But now I am facing another problem.
When I rotate the Box2D object, the sprite gets ...
0
votes
0answers
342 views
Problem with rotation in Box2D
I have my sprites and my bodies, and my problem is the following:
I rotate a sprite that doesn't have a body, but it has a projectile as a child, and that projectile has a body attached to it, and ...
0
votes
0answers
217 views
Box2D high-level c++ wrapper
Is there a high level wrapper around Box2D out there?
I know that the library isn't exactly very low level as-is, but in my opinion some things in the library could be made more intuitive at the cost ...
0
votes
0answers
833 views
Multiple spawned objects on collision - Corona SDK
Please help! I'm trying to spawn 5 balls one by one from the sky and have them disappear as soon as they hit the ground or when they hit another user-controlled object that's on the ground. The good ...
-1
votes
0answers
23 views
Applying the vector of a swipe movement to a box2d object
Hi I'm trying to achieve game functionality where the player can place their finger on an object then swipe in a certain direction and apply the speed and velocity of the swipe to the object they have ...
-1
votes
0answers
33 views
How to make askew slope image(b2body) in Box2d?
I am new in Box2d and learning myself. I am learning Box2d from here http://www.box2d.org/manual.html#_Toc258082972
I want to make a body and want to give b2body a angle so that it will look like ...
-1
votes
0answers
19 views
FlipX Sprite By Checking Position
I have bird flying. My bird is flying but i want it to fly right and left using flipX.
I want when my bird fly right it should flipx=No and when it goes left my should flipX=Yes.
simple like duck ...



