Game Development Reference
In-Depth Information
7. As the animations are ready, create the sequence action for it using an array.
NSArray* coinAnimationsSequence =
[NSArray arrayWithObjects:coinGroupAnimation,
coinAnimationFinishedCallBack, nil];
SKAction* coinSequenceAnimation =
[SKAction sequence:coinAnimationsSequence];
Hence, the coin looks as if it is disappearing when the preceding complex actions
run on the coin.
[coinNode runAction:coinSequenceAnimation];
8. As all the code of the animation and collision detection is done, call the de-
techSpaceShipCollisionWithCoins method, so that in each frame the
collision is detected and the coin is collected by the character of the game (that is,
the spaceship).
[self detectSpaceShipCollisionWithCoins];
Search WWH ::




Custom Search