O'Reilly logo

Sparrow iOS Game Framework Beginner's Guide by Johannes Stein

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 – showing the game over scene

Use the following steps to create the game over scene:

  1. Open our Xcode project if it's not already open.
  2. Create a new Objective-C class inside the GameScenes group.
  3. Call this class GameOver it should be a subclass of Scene.
  4. Switch to the GameOver.h file.
  5. Using the following line of code, add a property called message:
    @property SPTextField *message;
  6. Using the following line of code, add another property to indicate whether the game was won:
    @property (nonatomic) BOOL gameWon;
  7. Switch to GameOver.m.
  8. Import the SceneDirector.h, Assets.h, and the World.h files, as shown in the following code:
    #import "SceneDirector.h"
    #import "Assets.h"
    #import "World.h"
  9. Add an initializer for this new scene, as shown in the following ...

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