0
votes
0answers
14 views

Prismatic Joint causes a crash-Box2D(cocos2d)

tried to set up a prismatic joint, but I get this error upon run time: Assertion failed: (IsLocked() == false), function CreateBody, file ...
0
votes
1answer
84 views

Dynamic Hills like Contre Jour in Cocos2d

I'm interested in maps/environments which are flexible and change at runtime, such as those in Contre Jour. I have looked for a long time to find out how to make this effect, but I couldn't find an ...
0
votes
1answer
46 views

Create body on a sprite (box2D)

I'm quite experimented in objective C, but now i'm tried cocos2D and his features. I need to add a body on a spritesheet (if possible on a classic 'UIImageView'), in order to detect collisions after. ...
0
votes
1answer
93 views

Move background with the player location

I want to move background with player location in ios . I have implemented the infinite parallax background by using the CCParallax class but i don't need it. I want to do something similar to this ...
0
votes
1answer
69 views

Getting a sprite from multiple sprites for right material pattern

Not sure how accurate the question was but I'll put it this way. I'm developing a game where player will construct his/her own stuff, like bridge, building etc. using cocos2d-iphone and Box2D. First ...
1
vote
1answer
616 views

2D Destructible Terrain with Box2D / Cocos2D -> Image Tracing

Bear with me as this will be a rather lengthy post. For the last month I have been working on an open source Cocos2D, Box2D Destructible Terrain Engine. I have some questions regarding its ...
1
vote
1answer
65 views

Ring and Pole - Box2d

How I can make a b2Body in box2d so that it could form a ring which does not collide from the center just like a ring. like when we flick the object and there's another body (like pole), the pole can ...
0
votes
0answers
105 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 ...
4
votes
1answer
399 views

Collision Filtering in Box2D

I have four bodies in my Box2D World. Each are polygon shape, with some physics parameters. Now when the game start, I need one of the bodies from the World (BodyA) to not be allowed to collide with ...
2
votes
1answer
574 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 ...
0
votes
1answer
196 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
741 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
345 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
515 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: ...
1
vote
1answer
298 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 ...
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
477 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.
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
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
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
837 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 ...
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
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 ...
2
votes
2answers
227 views

Moving 2d camera in the y direction

I'm developing a simple game for the iphone and am struggling to work out the best way for the camera to follow the main character. The following picture hightlights the three main components: ...
0
votes
2answers
919 views

Constant rotation of a revolute joint in box2d

I would like to have a line with one end attached to a location and have it rotate constantly (with the same speed) with a maximum of 45 to -45 degrees (i.e. I would like to have it swing like a rope ...
5
votes
1answer
449 views

Do I need to roll my own polygon segmentation algorithm to automate Box2d body creation from a tile map?

Before re-inventing the wheel I figured I'd ask: I'm working on a tile-based 2d-maze level generator for cocos2d + box2d. The idea is: I'm using one of the well-known graph traversal algorithms to ...
2
votes
0answers
310 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 ...
0
votes
1answer
231 views

Why set the position of both b2Body and Box2DSprite?

In a game, we add a body for each sprite, the method is: createBodyAtLocation:(CGPoint) forSprite:(Box2DSprite*)sprite In which we create the body and we attach it to the sprite in parameter: ...
1
vote
3answers
1k views

Include Box2D libraries to a cocos2d project (iOS)

I have a problem including box2D to my cocos2d project. I've tried different ways to do it with no success. This is what I've done: I downloaded Box2D (Box2D_v2.2.1) to my project directory. Dragged ...
0
votes
1answer
1k views

b2Body moves without stopping

I got a quite strange bug. It is difficult to explain it in two words, but i'll try to do this in short. My b2Body has restitution, friction, density, mass and collision group. I'm controlling my ...
2
votes
2answers
707 views

Efficient Bullet Firing Class

I've been struggling with this for a while. I have been trying to create a bullet pool class for a game I have made that doesn't cause a significant fps drop. I have tried creating a bullet pool ...
1
vote
1answer
1k views

Making an object swing from one rope to another

I am trying to make a Tarzan like game with Cocos2D and Box2D. I am having issues with the physics - making an object swing from one rope to another. I am not really sure how to do this. Could anyone ...
2
votes
2answers
586 views

Physics in carrom like game using cocos2d + Box2D

I am working on carrom like game using cocos2d + Box2D. I set world gravity(0,0), want gravity in z-axis. I set following values for coin and striker body: Coin body (circle with radius - ...
1
vote
1answer
726 views

How to make box2d mouse joint works similar to box2d setposition

I want to make b2mouse joint working similar to b2setposition, though i know in mouse joint force is applied, so it's not possible to reach the desired point without any delay like setPosition(), but ...
5
votes
4answers
1k views

How to port a game from IPad to Iphone [closed]

I just finished developing a 2D side scroll game for the IPad using Cocos2d and Box2d. Now we want to make an IPhone 4 version of the game, but I'm still not sure what is the best way to do it. I ...
1
vote
0answers
173 views

Which is the best model to present the destruction of the building in Box2D? [closed]

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 ...
4
votes
1answer
501 views

Worth using Box2d for collision but not physics?

I am currently doing some work in cocos2d-x and am thinking about using their box2d implementation for things like collision detection (but not necessarily response), range detection, and other things ...
0
votes
2answers
234 views

Slow motion of a spherical object on an blunt slant obstacle

In cocos2d environment and box2D when an spherical object falls on a blunt slant obstacle, it moves really slowly, that's nauseating, if you have coded to not to have any interaction with world while ...
-1
votes
1answer
287 views

Is it any good to make play game in zoom condition?

I'm developing a game with large obstacle and sprites(in cocos2d+box2d for iPhone), then after zooming out my sprites and layer (by increasing cameraZ), I make my game to play by user, which causes ...
1
vote
1answer
903 views

Stretching textures for CCSprites in Cocos2D

I'm making a game for iPhone and iPad w/ Cocos2D and Box2D. I scale the size of square objects ("blocks") using a pixel-to-meters ratio depending on the particular device. Can I stretch or shrink ...
1
vote
2answers
1k views

Looking for the reference tutorials for the joints in the Box2D for iphone

I can't find the tutorials of joints class in the Box2D for iPhone. I am unable to run a Testbed for iPhone Box2D. (void)ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { if ...
1
vote
1answer
244 views

Mouse joint isn't restricting the ball from going to the other part of the screen

I'm developing a application in cocos2d using the Box2D framework, but unfortunately I am having issues. I'm not able to restrict the orange ball in the half screen area, taking the image below as ...
8
votes
1answer
3k views

Basic Box2D collision detection

I don't understand how to listen for collisions in Cocos2D/Box2D. Say I have two dynamic circle bodies. One is very small and the other is relatively large. When the small circle collides w/ the ...
3
votes
2answers
1k views

When and how should I apply forces in a Cocos2D + Box2D game?

I have some small circles just rolling across the bottom of the screen in my Cocos2D/Box2D iOS app. The bodies are dynamic... so I make them roll by applying a horizontal force to the center of mass ...
2
votes
1answer
670 views

Cocos2d+pybox2d vs Cocos2d-Iphone

Myself and two colleagues are working on making our first indie game for PC and, we decided to use Cocos2D + PyBox2D. We decided this based on what we've seen of Cocos2D-iPhone games, but I'm not ...
5
votes
2answers
2k views

How to make bird to fly using box2d

I am new to Box2D, I have set gravity to 10. How to make an object fly in space even though the gravity is 10. What are the properties I need to set to make object fly? Is there any different ...