Box2D is an open-source rigid-body 2D physics simulation library for games, written in C++.

learn more… | top users | synonyms

-1
votes
1answer
207 views

Parallax With Box2d iphone

I am creating the simple game. In that game car will move and obstacles will come in the car way we will have to save that car from that obstacles. What I have done. I have created the car with the ...
-1
votes
1answer
1k views

Create Box2D and engine polygon Box2D body without sprite

Hey I have created my body using following code: (please read full description) Body polyBody; final BodyDef mBodyDef = new BodyDef(); mBodyDef.type = BodyDef.BodyType.DynamicBody; ...
3
votes
1answer
2k views

Getting Bodies to go “Super Fast” in Box2D

I am making a breakout game in Android using the LibGDX version of Box2D. I have a ball that I am applying a force to with the following code... getBody().applyForceToCenter(-10000000000.0f, ...
5
votes
1answer
574 views

box2d with lines

I have a very simple platform game builder and I've specified the ceilings, walls and floor as line segments. A line has a winding, or normal; you can determine the direction that a line should be ...
0
votes
1answer
2k views

How to create Elastic rope / Rubber band in box2d?

I am trying to create the rubber band type or elastic rope. i ant to do something like bellow link. http://heyalda.com/smash-turtle/ Thanks,
2
votes
2answers
832 views

Non-physics character movement in a Box2d Environment

I am in the process of creating a physics platformer. However, I want the player movement to feel very old-school(as in: non-physics like), which means that the character: Should always move equally ...
1
vote
1answer
103 views

Best way to have a body with 1 dimensional linear only movement in Box2D

I have a body that I am using as a paddle, it is expected to move in a vertical fashion and other objects should "bounce off it". The paddle itself should never move horizontally. According to the ...
-1
votes
1answer
107 views

How to create strength meter?

I am creating game like bow and arrow. I want my hero will shoot the arrow with the strength meter, how will create the power?
1
vote
2answers
1k views

Moving player in Box2d without forces

How do I move player with keyboard without applying forces? If I do playerBody.setLinearVelocity(new B2Vec2(0, 2)) it moves the player but when I release the key for movement, the ball is continuously ...
2
votes
1answer
1k views

Stopping on a slope in Box2d

I am creating a simple platformer using Box2d. I've implemented a variant of the technique described here. To make the player character move more 'platformer-like' I want him to stop on (shallow) ...
1
vote
1answer
170 views

How to handle sprite speed when objects move using Box2d?

I have a basic platformer using Box2d that works great. However, I now want to stop using my default square, and implement some running and jumping animations. How can I ensure that: When running, ...
4
votes
3answers
3k views

Box 2d Level Editor for AndEngine

I am getting started with Box2d in AndEngine. I need to know if there is any level editor to be used with box2d and gives output capatable with AndEngine. Is there any tool which can help me building ...
2
votes
1answer
446 views

How to make a character in a Box2D world jump faster?

I have a question about using Box2D to simulate a physics-platformer. I manage to make the character move to the right and left, and jumping as well. However, jumping seems extremely slow when ...
2
votes
1answer
239 views

Best way to allow a user to Control Body in Box2D

I am working on a simple game and I am deciding how I should let users interact with the world. I really have 2 options, 1.) When the user moves an object I apply a force to the body 2.) With each ...
2
votes
2answers
973 views

How do I get the touch event on a body in Box2d(Java)

I have various bodies rotated at some angle with the help of Box2d in libGDX. What I want is to destroy the body when I click on it, but the problem is that I am not able to get the area definition of ...
1
vote
2answers
2k views

Applying Forces to Box2D Bodies

In full disclosure, I am VERY new to box2D let alone the Java version of it. I have a box (here of type Hero) that I am trying to move. I did this by trying to apply a force as follows... private ...
5
votes
3answers
245 views

What could cause a sudden stop in Box2D?

I'm using Box2d for a game, and I have a bug that's driving me nuts. I've simplified the situation down to a square player sliding back and forth frictionlessly on top of a floor composed of a series ...
3
votes
0answers
212 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
2answers
819 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 ...
0
votes
1answer
105 views

Questions for QueryAABB

I'm currently having trouble getting my head around QueryAABB, and hope to find some answers here. The LowerBound of an AABB the upper-left corner (and vice versa). Why is that and what idea is ...
4
votes
1answer
110 views

How to detect whether an Object came to sleep at a specific position?

I'm currently writing a small game with box2dweb and I need some direction for this: I'm throwing a Box and have to hit a specific place and trigger an event when the object that's been thrown isn't ...
0
votes
1answer
151 views

How to get the Exact Collision Point and ignore the collision (from 2 “ghost bodies”)

I have a very basic problem with Box2D. For a arenatype game where you can throw scriptable "missiles" at other players I decided to use Box2D for the collision detection between the players and the ...
-1
votes
2answers
264 views

Single and Double Jump with single button.

I want to make Single Jump on Single Tap and Double Jump on Double Tap. My problem is that if I make double Tap on ground then it’s fine but if I make first Tap on ground and second Tap in Air then ...
1
vote
0answers
165 views

Flick Kick like game with box2d and flash as3 [closed]

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 ...
0
votes
1answer
134 views

Basic Use of ApplyImpulse

I am trying to apply a force to a bunch of b2_dynamicBodys, but it seems to only work for a random number of items and then stops with an error. //create some items to move bodyDef.type = ...
1
vote
1answer
347 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
votes
1answer
499 views

Attach my sprite with Box2d [closed]

I'm coding Javascript(HTML5) with Box2D. And I want to ask how to attach Sprite with Box2D. This is function My sprite: function My_Sprite() { this.m_Image = new Image(); this.m_Position = ...
2
votes
1answer
2k views

Specifying force and angle in ApplyImpulse in box2d

I need to apply an impulse on a object with a particular force and at a particular angle in Box2d. If I am right the syntax would be the following: body.GetBody().ApplyImpulse(new ...
2
votes
1answer
564 views

What's the best way to handle slopes for a platfomer game using Box2D

I would like to know if there is any known solution for handling the player's movement on slopes using Box2D engine. I tried to do it using a circle as the player. Everything was fine until I tried ...
2
votes
1answer
629 views

Directional Lights

I'm working on a game idea (2D) that needs directional lights. Basically I want to add light sources that can be moved and the light rays interact with the other bodies on the scene. What I'm doing ...
5
votes
2answers
2k views

How to create an extensible rope in Box2D?

Let's say I'm trying to create a ninja lowering himself down a rope, or pulling himself back up, all whilst he might be swinging from side to side or hit by objects. Basically like ...
0
votes
1answer
233 views

Box2dWeb positioning relative to HTML5 Canvas

I'm new with HTML5 canvas and Box2DWeb and I'm trying to make an Asteroids game. So far I think I'm doing okay, but one thing I'm struggling to comprehend is how positioning works in relation to the ...
1
vote
1answer
87 views

Counting no.of bodies present in certain area in box2d?

I am stuck on it:how can i count or find the no.of bodies present in any area in as3?would be thankful if any guys help me out.....
1
vote
0answers
324 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 ...
2
votes
1answer
395 views

How do I make a rope from point A to B in Box2D?

I need to make a rope (preferably not elastic) from one point to the next in Box2D. If it helps, I'm trying to develop one of those 2D Spiderman games, like this: ...
-2
votes
1answer
326 views

How to fly enemies like galaxian game enemies?

I am developing game like galaxian and using cocos2d with box2d .I don't have idea how to create enemies like galaxian game enemies and how do they fly over the screen. ...
4
votes
2answers
365 views

Detecting a ledge in Box2D [duplicate]

Possible Duplicate: Detect Open Space in Farseer How do I detect ledges? I'm making a 2D platformer with Box2D. The player needs to be able to grab onto a ledge and pull him/herself up. ...
2
votes
3answers
802 views

Rotate Body From Corner

I want to ask that how to rotate body from corner? movableBeam.getBeamBody().setTransform(movableBeam.getBeamBody().getPosition(), angle); The above line of code rotate the beam from center that I ...
1
vote
1answer
470 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 ...
2
votes
1answer
572 views

RagDoll in AndEngine

I want to create a RagDoll body in andEngine which can run and jump over different jumpObjects. Can any one give a nice tutorial on how to create RagDoll body and how to move it, like jump and ...
3
votes
3answers
517 views

Semi Fixed-timestep ported to javascript

In Gaffer's "Fix Your Timestep!" article, the author explains how to free your physics' loop from the paint one. Here is the final code, written in C: double t = 0.0; const double dt = 0.01; double ...
2
votes
1answer
328 views

Implementing a wheeled character controller

I'm trying to implement Boxycraft's character controller in XNA (with Farseer), as Bryan Dysmas did (minus the jumping part, yet). My current implementation seems to sometimes glitch in between two ...
0
votes
1answer
244 views

box2d tween what am I missing

I have a Box2D project and I want to tween an kinematic body from position A, to position B. The tween function, got it from this blog: function easeInOut(t , b, c, d ){ if ( ( t /= d / 2 ) < ...
0
votes
1answer
342 views

GetContactList stops reporting collisions on welded bodies

I have some strange problem with my game which uses Box2D as physics engine and I'm out of ideas on what I can do to solve it. My game is a class assignment where I need to build a simple game where ...
1
vote
0answers
455 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. ...
0
votes
2answers
555 views

How to move Objects smoothly like swimming arround

I have a Box2D project that is about to create a view where the user looks from the Sky onto Water. Or perhaps on a bathtub filled with water or something like this. The Object which holds the fluid ...
2
votes
1answer
647 views

Pathfinding and BSP with Box2D

I'm looking into implementing AI in my 2D side-scrolling platformer, and I'm looking into using algorithms such as A*. For many kinds of pathfinding, we need some sort of grid or systems of nodes or ...
3
votes
1answer
1k views

Andengine. Put bullet to pool, when it leaves screen

i'm creating a bullet with physics body. Bullet class (extends Sprite class) has die() method, which unregister physics connector, hide sprite and put it in pool public void die() { ...
0
votes
1answer
175 views

Box2d — get free space

I am developing a little Game with something like particles, where every particle is represented by a box2d Body. To insert new particles I need to find a place in the b2World where no bodies reside. ...
4
votes
1answer
2k views

making a box2d body move along a Bezier curve/ arc path

I have been trying to make a box2d body move along a Bezier curve/ arc path. Most of the posts I've seen recommend an approach of manipulating SetLinearVelocity and SetTransform to arrive at an ...