Game Development Reference
In-Depth Information
start buttons should have their
Selector
fields set to
shouldExitGame
and
shouldRestartGame
, respectively. That's what's important for functionality, the rest
is just visual appeal. I'm not saying that visuals aren't important too, but they're not as
important for continuing with the topic.
But you are free to spend some time to animate the nodes on the menu shown in
Figure
the
Game over
label node, and then add multiple
Color
keyframes by pressing
C
. Move
the Timeline Cursor onto each keyframe and, on the
Item Properties
tab, click the colored
rectangle next to the
Color
property, which presents the OS X color-picker dialog to let
you pick a color. Right-click the individual
Keyframe Segments
, and change the easing
modes to whatever you like.
Figure 6-10
.
What the Game Over menu might look like
Run this animation and you'll weep tears of delight. Such vivid colors. But enough with
the sentimentalities. Art really isn't my strong point, so let's move on to kill the player.
Showing the “Game Over” Popover
Go back to Xcode, and open
GameScene.m
. Locate the
ccPhysicsCollision
methods, and below the last one, add the collision method shown in
Listing 6-17
.
Listing 6-17
.
There will not be blood: responding to a collision between player and saw
-(BOOL) ccPhysicsCollisionBegin:(CCPhysicsCollisionPair
*)pair
player:(CCNode *)player
saw:(CCNode *)saw
Search WWH ::
Custom Search