Game Development Reference
In-Depth Information
in
Figure 6-8
will appear, where you should enter
resumeGameDidEnd
in the
Selector
field.
Tip
The sound effects keyframes are also added by Option-clicking on the
sound-effects segment, and they're editable by double-clicking a keyframe.
Figure 6-8
.
Editing a Callbacks keyframe
As with other keyframes, you can also right-click a
Callbacks
or
Sound effects
keyframe
to
Cut
,
Copy
, or
Delete
it. You can also delete keyframes by selecting a keyframe with a
left-click and pressing the
Backspace
key.
Note
If you receive a message that says “the root node cannot be removed”
when trying to cut or delete a
Callbacks
or
Sound effects
keyframe, just deselect
the root node by selecting any other node or by clicking on the stage, outside
any node, to deselect the currently selected node(s).
You've already added the necessary code to handle resuming a game in
Listing 6-9
.
The
shouldResumeGame
method runs the
resume game
Timeline, which in turn will even-
tually run the
resumeGameDidEnd
selector.
If you build and run the app now, pause the game, and then click resume, the pause menu
popover will disappear after two seconds and the game continues.
You can also restart the level and exit to the menu now, as the
SceneManager
will
change scenes. (See
Listing 6-13
.) As an exercise for you, you may want to add another
SceneManager
class method that presents the
GameScene
but without using a trans-
ition. Then update the
shouldRestartGame
method to use your new
SceneMan-
ager
method.
Search WWH ::
Custom Search