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

learn more… | top users | synonyms

1
vote
0answers
306 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
372 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
310 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
320 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
704 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
405 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
524 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
459 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
323 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
227 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
311 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
381 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
506 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
597 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
170 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
1k 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 ...
1
vote
2answers
2k views

Can i add friction in air?

I have issue regarding speed in air. When i jump and move simultaneously that time speed of player increase.For jump i am using impuls and for movement i am using force.I want to slow speed when ...
1
vote
2answers
563 views

strange behavior in Box2D+LibGDX when applying impulse

I have been playing around with Box2D and LibGDX and have been using a sample code from DecisionTreeGames as the testing ground. Now I have a screen with four walls and a rectangle shape, lets call it ...
6
votes
1answer
612 views

Farseer Physics: Ways to create a Body?

I want to create something similar to this using farsser and Kinect: https://vimeo.com/33500649 This is my implementation until now: http://www.youtube.com/watch?v=GlIvJRhco4U I have the outline ...
0
votes
1answer
193 views

Creating multiple fixtures in one body

I want to create this type of fixture in one body. Here square and circle both are different fixtures but attach to one body. How do I do this?
1
vote
2answers
210 views

Confusing box2d forces

Hello Friends. This is my demo game screen-shoot. Here i am using three buttons. Right-bottom button is used for jump and left-bottom buttons used for move left and right. I have some questions 1) ...
1
vote
0answers
740 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
1answer
127 views

Sprite Body can not stop

Hey i have issue regarding jump sprite body. In my code i am using moveLeft and moveRight Button and when i am press moveRight Button using following code if (moveRight.active==YES) { ...
0
votes
1answer
343 views

moving box2d bodies in an arc or curved path

How can I make a b2Body move in a arc-like or curved path? I have heard about cocos2d Bezier curve function (ccBezier) but this is for moving cocos2d sprites. Or can it be modified to move box2d ...
0
votes
1answer
514 views

EXC_BAD_ACCESS error when box2d joint is destroyed

When I destroy the weldJoint in the update method (see below) I get an EXC_BAD_ACCESS error pointing to the line world->DestroyJoint(weldJoint); in the update method below: -(void) update: ...
0
votes
2answers
416 views

How to move a b2Body explosively to a new Location

I am building an Game based on Box2d with the following basic structure: The Box2d World itself does not have any Gravity and is filled with some bodies (sheres and simple polygons) of more or less ...
1
vote
1answer
907 views

AndEngine Physics: Shape rotating but not updating physics effects

I was looking at PhysicsExample from AndEngine's Examples. I made the following change that I added a vertical line shape and created a fixture for it. Then I registered a rotation modifier for that ...
0
votes
0answers
137 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 ...
1
vote
1answer
297 views

Cocos2d: Using single timer/scheduler for multiple sprites

want to know if is it possible to use single timer or scheduler method for multiple sprites ? Like I am now working on a game and there could be any number of sprites and i want to perform some ...
3
votes
1answer
293 views

What algorithms exist for generating collision geometry from an image?

I am currently working on a game using SFML and Box2D. I am interested in generating collision geometry from the sprite data that I load into SFML. So, for example, an algorithm that would do this ...
2
votes
0answers
302 views

Box2d based tile map game scrolling problem [closed]

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
1answer
1k views

How change the size of sprite in cocos2d?

I want to change the scale of sprite like a paper in 'Paper Toss' game. 'Paper Toss' is the game is available on the App store. I want to make a sprite like a paper and change the scale of sprite ...
0
votes
1answer
473 views

Cocos2d Box2d contact listener call different method in collided object

I have the building object, wen it hit with other, i want to call some method inside it. Building.mm -(void)printTest { NSLog(@"printTest method work correctly"); } in my ContactListener i ...
1
vote
1answer
521 views

How make a laser path prediction line like a “slingshot cowboy” game?

How so I make a laser path prediction line like a “slingshot cowboy” game in cocos2d or box2d and select the target like "slingshot cowboy" game.
6
votes
2answers
542 views

Show path of a body of where it should go after linear impulse is applied

I am making a game with Andengine and Box2D. I have a dynamic body and I apply linear impulse on the body to move it around when the user have touched the screen. Now I want to show the path where ...
1
vote
1answer
271 views

How do I identify a collision with a specific body?

How can I identify when the ground body collides with another b2Body? I can use b2ContactListener to be notified of collision events, but how do I tell which bodies collided?
-1
votes
1answer
147 views

Interacting with box2D objects

How can I interact with an object in box2d, I'm completely new to this so I have no clue what to do. The box is created like this: bodyDef.type = b2Body.b2_dynamicBody; fixDef.shape = new ...
1
vote
1answer
113 views

Why is the MaskBit maxed out

Hi there for some reason the maskbit of my b2FixtureDef is being maxxed out and im not sure why Here is the declaration of the items that are used in the game enum PhysicBits { PB_NONE = 0x0000, ...
1
vote
2answers
216 views

Box 2D Collision Question

I am very new to Box 2D Physics world. I wanted to know how to collide 2 bodies when one is Dynamic and other is Kinematic. The whole Scenario is explained below: I have 3 balls in total. I want to ...
4
votes
1answer
448 views

Cocos2d: Tongue effect like in Munch Time

I'm wanting to do a tongue effect for my character like the one in Munch Time( shown in pic ). The player does some action and his tongue attaches to the nearest platform. I'm thinking this is ...
1
vote
0answers
242 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 ...
2
votes
2answers
835 views

Simple 2D Flight Physics with Box2D

I'm trying to build a simple side scroller with an airplane being the player. As such, I want to build simple flight controls with simple but realistic-feeling physics. I'm making use of cocos2D and ...
1
vote
1answer
823 views

RevoluteJoint Stop Rotating when Some Physics Body Collide in Andengine + Box2d?

I am making a Game from andengine + box2d in Which i am using RevoluteJoint in that case i am facing some problem that when physics body or Sprite Collide with this Revolute joint body then Revolute ...
2
votes
4answers
1k views

Should I used Box2D for a Flash platformer or use something for gaming like Fixel or Flashpunk?

I'm trying to make a platformer with Flash/AS3 and have been looking for something to help with some of the collision etc. I've look at a few engines and Box2D/WCK seems the most sophisticated. Do I ...
7
votes
4answers
2k views

How do I make my rain effect look more like rain and less like snowfall?

I am making a game in that game I want a rain effect. I am little bit far from this right now. I am creating the rain effect like below: particleSystem.addParticleInitializer(new ColorInitializer(1, ...
-4
votes
2answers
786 views

How can I create a rain effect?

I'm making a game in which I want a rain effect, like rain is coming and game play normally.
0
votes
1answer
2k views

How to simulate a water splash effect?

I need to achieve the effect of a ball falling down into a pool then splashing in the water. At first, I made a sensor to detect the collision between the ball and the water and then show the sprite ...
1
vote
1answer
2k views

Setting a Box2D Bodies Center?

How do I set the center of a fixture/body consisting of multiple shapes (triangles)?
1
vote
1answer
462 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 ...