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
18
votes
2 answers

Proper Swipe gesture recognizer iOS

I haven't been able to find a tutorial on how to properly setup a gesture recognizer for iOS. I need to detect swipe up & down, and the callbacks for them. Any help, appreciated. Thanks.
iamruskie
  • 766
  • 4
  • 9
  • 22
15
votes
1 answer

Box2d multiple fixtures and positioning

I'm attempting to create a "U" shape in Box2d (in Cocos2d) by joining 3 rectangles like so: |_| It sounds like joints are not the correct solution here since I don't want any movement so I have created a main body which is the middle bit and 2…
GivP
  • 2,634
  • 6
  • 32
  • 34
11
votes
1 answer

How can I prevent a ball from sticking to walls in Box2D?

I'm experimenting with box2d. I seem to have a problem people describe as sticky walls I have a ball and a paddle I'm using all the basic recommended scales I could find, 10m world, 1m ball The ball has the following properties: shape: circle (.5f…
Rob
  • 7,039
  • 4
  • 44
  • 75
11
votes
1 answer

changing box2d body shapes dynamically

Is it possible to change the shape of a Box2d b2Body dynamically? I want to do this to achieve the following. i). Increasing the radius of a circle shape at a certain rate ii). Changing the dimensions of a bounding box for a sprite to match the…
oopology
  • 1,072
  • 1
  • 10
  • 19
11
votes
3 answers

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 right now is some test where using sensors (box2d)…
Sebastián Castro
  • 1,408
  • 10
  • 28
9
votes
2 answers

Simulating water resistance in Box2D

I'm making a game where player drags a boat around using finger. I'm using Box2D for the physics aspects of the game. In particular, I'm using b2MouseJoint to attach the touch event to the boat to let the touch event drag the boat. But there is one…
Lukman
  • 18,462
  • 6
  • 56
  • 66
7
votes
5 answers

cassert file not found but i use Box2d template

i am using cocos2d template with Box2d but when i import Box2d.h in my project it gives me error cassert fiel not found i have cocos2d version 2.0 please help me
Faheem Rajput
  • 591
  • 4
  • 8
  • 17
6
votes
4 answers

std::vector in objective c method

Im working in objective C++. The issue I am stuck with is that I need to pass a std::vector to an objective c method. Is this possible? Below is my current code where I am having to do my calculations on the vector in the vector definition method…
coasty
  • 199
  • 1
  • 2
  • 11
6
votes
4 answers

HTML 5 game development tools

Can anybody please guide me with the best engine for game development in HTML5? It is simple jumping and surface detection game. The theme is like jumping and go above the tree tops. What you suggest in this case? I am targeting Android and iOS…
Asad Nauman
  • 971
  • 11
  • 19
6
votes
1 answer

cocos2d, box2d and retina mode: give up, or try to get it to work?

I've been trying to get my box2d game to work in retina mode, and I'm running into a lot of irritating issues when running in higher-resolution mode. cocos2d renders my graphics correctly in retina mode, but I'm finding the need for hack after…
Rob
  • 25,984
  • 32
  • 109
  • 155
6
votes
1 answer

cocos2d and box2d : sprite touch not get properly

I have added 7 sprites and give them tag and zorder.. but i can't get touch on third object and at last there is only one object remained then i get touch of it.. But when i added 6 sprites i'll get touch properly. all sprites positions are same but…
Hiren
  • 112
  • 7
6
votes
1 answer

How to properly allocate and deallocate box2d objects in cocos2d, iOS

I wonder what is the best way to allocate and deallocate box2d objects (b2World and b2Body) in cocos2d for iOS? Allocate @property (nonatomic, assign) b2World * world; @property (nonatomic, assign) b2Body * body; Deallocate -(void)dealloc { …
knagode
  • 5,816
  • 5
  • 49
  • 65
5
votes
1 answer

Moving Box2d Bodies Like CCSprite Objects

In cocos2d, you can ease in CCSprites and move them around in all kinds of ways. Most importantly - they can have easing in/out. For most games this is desirable for smooth movement etc. id action = [CCMoveTo actionWithDuration:dur…
Aram Kocharyan
  • 20,165
  • 11
  • 81
  • 96
5
votes
2 answers

Only Integrating Box2D collision detection in my 2d engine?

I have integrated box2d in my engine, ( Debug Draw, etc. ) and with a world I can throw in some 2d squares/rectangles etc. I saw this post, where the user is basically not using a world for collision detection, however the user doesn't explain…
Goles
  • 11,599
  • 22
  • 79
  • 140
5
votes
2 answers

Balance box2d objects

Please check the attach image it's a kind of seesaw. But as from image the black bodies have same density. And the horizontal rectangle is attached with the triangle using "Revolute" joint. But still not working any suggestion. in the current…
Hamdullah shah
  • 804
  • 5
  • 15
1
2 3
27 28