Tagged Questions
1
vote
0answers
126 views
iOS cocos2d - sprite gets stuck in collision detection
I'm developing a top down game in cocos2d and I have collision code that checks collisions between enemies and the player so that they don't go through each other. The code seems to work but the ...
3
votes
1answer
106 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 ...
0
votes
0answers
105 views
Detect Sprites, they are in Shape or Not which random draw in Cocos2d
I have searched a lot on web and found some of help ful links as exact my question.
Link 1 Link 2
But still i am not success to achieve this,
i have done some of code lines, as like draw line by ...
0
votes
2answers
411 views
Collision detection on a 2D hexagonal grid
I'm making a casual grid-based 2D iPhone game using Cocos2D. The grid is a "staggered" hex-like grid consisting of uniformly sized and spaced discs. It looks something like this.
I've stored the grid ...
2
votes
1answer
118 views
Change collision action
I have a collision detection and its working fine, the problem is, that whenever my "bird" is hitting a "cloud", the cloud dissapers and i get some points. The same happens for the "sol" which it ...
0
votes
1answer
352 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 ...
5
votes
1answer
361 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
2answers
471 views
Issue with removing sprites on collision
I'm trying to make a very simple collision detection procedure just for test purposes.
The problem is with the send/receive information between functions
I have these lines on the update method ...
0
votes
1answer
114 views
CCSprite x and y comparison
I have 2 CCSprites and I want to tell if their x and y are equal I tried this:
if(sam.position.x == tom.position.x && sam.position.y == tom.position.y){
NSLog(@"Hooray!");
}
Although I do ...
2
votes
2answers
521 views
Registering collision on particles
I am using CCParticleSystemQuad to create particle effects. But I want my sprites to be able to collide with particles. Say your character is a dragon, the dragon breath is a particle effect emitting ...
1
vote
2answers
911 views
Setting up collision using a tilemap and cocos2d
I'm building my first platformer using cocos2d and a tilemap. I'm having trouble coming up with a decent way of determining if the character is colliding with an object. More specifically, in which ...