O'Reilly logo

Cocos2d for iPhone 0.99 Beginner's Guide by Pablo Ruiz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action - ready, set, go!

Right now when you launch the game, it just starts playing, and the time begins running out. Let's change it, so the player can prepare himself before the action begins.

We will just be adding a nice "ready, set, go!" message that will work as follows:

  • A "Ready" sprite appears and disappears with a nice fadeout + scaling, and then we use CCCallFuncN to remove that sprite from the game
  • The same for the "set" sprite
  • The same for the "go!" sprite, and also we use CCCallFuncN to set a variable that allows the player to touch the stones and the time to start running out

So, let's put that into practice.

  1. First, include the three images in the project like we have been doing. You can find them in the companion files for this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required