Hot answers tagged cocos2d-iphone
The difficulty of an endless runner is dependent on a few things, first of all the size of the obstacles and different types of obstacles, typically it's best to just hardcode when different obstacles can appear and use a formula for sizes (especially when you can only use a given dodge ability for a certain amount of time). A good formula for the size of ...
If you have sleeping allowed (and the b2_timeToSleep is sufficiently short for your needs) you can use the b2Body::isAwake function to test if a rock is settled. Pseudo-code: For body in bodies: If(body is rock and not body->isAwake()) Then //Apply impulse End If End loop
I think you're getting your pixel coordinates and tilemap coordinates confused. Tile coordinates count tiles. Pixel coordinates count pixels. To convert from a pixel coordinate to a tile coordinate, divide the click_x by the tile width and the click_y by the and tile height, to get the tile coordinates x and y. (Discard the remainders to get an ...
CCParticleSystemBase has an autoRemoveOnFinish property. The name is self explanatory. This property is NO by default. So should be set to YES on creation for particles that have a finite lifetime.
The trick is to use the CCScrollViewDelegate methods to detect scroll events. Add a CCLabelTTF and call it _pageLabel. In Xcode, make the scene containing your scroll view adhere to the CCScrollViewDelegate : @interface myScene : CCNode <CCScrollViewDelegate> Then, in didLoadFromCCB, set the scroll view delegate to self : _scrollView.delegate = ...
That error occurs on this line: CCTexture *texture = [CCTexture textureWithFile:image]; And this is the right way to do this: CCTexture *texture = [[CCTexture alloc] initWithCGImage:image.CGImage contentScale:image.scale];
Only top voted, non community-wiki answers of a minimum length are eligible