Tagged Questions
0
votes
1answer
215 views
Touching a CGRect
In my cocos2d app I am trying to determine when a CCSprite is touched
Here is what I have:
-(BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event{
NSMutableArray *targetsToDelete = ...
1
vote
2answers
671 views
Basic game architechture best practices in Cocos2D on iOS
Consider the following simple game: 20 squares floating around an iPhone's screen. Tapping a square causes that square to disappear.
What's the "best practices" way to set this up in Cocos2D?
Here's ...
7
votes
2answers
2k views
How to differentiate a tap from a drag
I'm creating an app and I'm trying to make it so I can drag a sprite (with a second sprite on top) around the screen, but if I just tap the sprite some other method should get called.
I got the ...
0
votes
1answer
355 views
Where does touch control logic go?
I'm creating a game (or app, depending on how you would define it...) where I'm moving objects (with sprites) on the screen.
I've got this to half-work in both scenarios, but I can't seem to get it ...
0
votes
0answers
206 views
detect sprites by tag in parallax
I've created 3 layers and added to a parallax node in my game play scene;
I don't know why it crashes when I'm enabling touch, self.isTouchEnabled = YES; on one of my layers; I want that touch to be ...
1
vote
1answer
462 views
How can I scroll sprites when swiping using Cocos2D?
I'm adding 3 sprites (layers) to CCParallaxNode:
BGLayer = [CCSprite spriteWithFile:@"Layer.png"];
[_backgroundNode
addChild:BGLayer
z:2
parallaxRatio:layer1Speed
...
1
vote
1answer
510 views
Retrieving latest touch to interrupt another
In Cocos2D for iPhone, I want the latest touch event to interrupt another and ignore the last touch. Let me know if I need to elaborate more, but basically my game consists of a lot of finger ...