Questions tagged [box2d-iphone]

Box2D is a physics engine created by Erin Catto. This tag is similar to the box2d tag in that it is more specifically aimed at iOS development.

Box2D is a physics engine that is particularly popular among Cocos2D developers when developing a game for iOS devices. It is fairly fast and easy to use. More information can be found on its official website:

Box2D.org

For more information on Cocos2D (iOS) see:

Cocos2D-iPhone.org

410 questions
1
vote
1 answer

Make joints colliders

I have made a dynamically changing shape (blob) out of multiple nodes and distance joints. I would like to know how I can make the distance joints collide with the outside world. The nodes are just box2d circles and they already collide however an…
King Popsicle
  • 465
  • 5
  • 17
1
vote
2 answers

Box2d custom polygon and sprites mis-matching

I am using the Physics Editor for creating the Polygon in Box2d. It generates the Polygon and works fine in the non-retina display but doesn't work in the retina display..... I have attached the screen shot for both of the displays.Now when comes to…
Marine
  • 1,097
  • 7
  • 19
1
vote
0 answers

Ropes in cocos2d/box2d

Hello guys I have been experimenting with Cocos2d and box2d recently. I am trying to draw ropes as in games like Bunny Shooter, Cut the rope etc.. But I did not get any leads. I found out a class called VRope, but I am pretty unsure how to use it.…
Geo Paul
  • 1,777
  • 6
  • 25
  • 50
1
vote
2 answers

Lighting and shadows with Cocos2D and Box2D

I am currently developing a game for iPad & iPhone using Cocos2d with Box2d. It would have been majorly cool to achieve a lighting effect like the one in this video: http://www.youtube.com/watch?v=Elnpm-gNI04 and on this…
1
vote
3 answers

Projectile movement using Box2d.

I need to know how to use box2d for projectile motion. initially, projectileTime=0; then i call the following function for projectile motion. It works pretty good. But i want to achieve the same thing using box2d. As far as i know Box2d works only…
russell
  • 3,668
  • 9
  • 43
  • 56
1
vote
2 answers

b2RopeJoint how to implement this into box2d?

How do I put b2RopeJoint into my project. The newest Box2d version does not have b2RopeJoint in it. People online tell me to update my box2d but I have 2.1.2 which is the newest version. I'm so confused. Will someone please tell me how to implement…
1
vote
2 answers

Wheel animation according touch with cocos2D and (?) Box2d on iPad?

I have a question about cocos2d and box2d. I have to create a simple wheel that rotate according how the user touch the wheel for an Ipad App. I would like that according a certain touch movements the wheel start with a certain velocity, and after…
benza
  • 307
  • 1
  • 3
  • 13
1
vote
1 answer

How to gain access to Box2d's b2CollideCircles in Objective-C?

I'm trying to test out some collision detection with Box2d (using this method). I've added the source and headers to my XCode project, and have added a recursive ./** to my header search paths. It appears to build fine. Unfortunately, I can't use…
Ian Terrell
  • 10,667
  • 11
  • 45
  • 66
1
vote
2 answers

box2D: move body to the point(touchesEnded)

I'm new to BOX2d and I need to move the body and the sprite from the center to the point where there was contact with a low rate, I tried to use a projectile-> SetTransform (b2Vec2 (location.x / PTM_RATIO, location.y / PTM_RATIO), 0); but the…
Invader
  • 23
  • 10
1
vote
1 answer

Box2d Loop Shape, determine smooth landing

I'm writing a game where a circle shape lands on a b2LoopShape consisting of a few hundred vertices. I'm trying to determine whether my landing is smooth or not (landing along the edge or perpendicular to the edge) by using a contact listener but…
erik
  • 448
  • 5
  • 10
1
vote
1 answer

Box 2D - Is there a way to Move the Ground b2EdgeShape up

I'm working on an iPhone game, and the ground is a long, repeating rectangular sprite object that extends about 30 pixels above the bottom of the screen. I'm trying to align my ground edge shape 30 pixels so it when the player sprite lands on the…
Scott
  • 324
  • 2
  • 4
  • 15
1
vote
3 answers

Finding CGPoint by adding into distance of two CGPoints

I have two CGPoints A and B. Distance between A and B can be found with ccpDistance(A,B). With this information, I need to find programmatically CGPoint(x,y) of X by adding small distance into distance of A-B. A-B may can make a connecting line in…
WaJiyaz
  • 512
  • 1
  • 8
  • 25
1
vote
2 answers

cocos2d/box2d trouble

I have just started working with cocos2d and box2d for iOS SDK, and have a few problems. I got the templates working, and got the test app (the one where you click the screen and a box with a random letter appears) to compile. My first problem is…
Gus
  • 1,905
  • 6
  • 23
  • 37
1
vote
1 answer

Box2d SetLinearVelocity not working with gravity

I have a body (player) in my box2d world. Whenever I try to set its x velocity (every 2 seconds or whatever) and it is falling due to gravity, it jitters up and down. I have also tried to set its y velocity equal to gravity (-30.0f) but then it does…
Daniel Node.js
  • 6,734
  • 9
  • 35
  • 57
1
vote
1 answer

How to add a CCSprite (texture) to a polygon?

I am adding Box2D polygon's to my world and I can't figure out how to add texture to only the polygon shape. The polygon is a triangle and using the CGRectMake() for the rect: parameter while initializing my sprite gives me a sprite larger then my…
SteveWight
  • 75
  • 2
  • 8