Presentation is loading. Please wait.

Presentation is loading. Please wait.

Review Scene Management (Scene, Layer, Director) Sounds Menus

Similar presentations


Presentation on theme: "Review Scene Management (Scene, Layer, Director) Sounds Menus"— Presentation transcript:

1 Review Scene Management (Scene, Layer, Director) Sounds Menus
Sprites & Actions

2 Scene a scene is composed of one or more layers
app transitions take place through scenes typically one scene is used for the “playable” part of the game others scenes for: title, high scores, options

3 Layer a layer has the size of the device screen it defines appearance and behavior overlapping layers are typically given different functions (e.g, background, animation, menu)

4 Director the director takes care of moving between scenes
runWithScene tells director to use that scene replaceScene replaces the running scene with another pauseScene puts the current scene on hold for another transitions allow for fancy scene change iphone.org/wiki/doku.php/prog_guide:lesson_3._m enus_and_scenes

5 Scene Management We added:
A layer over the game layer showing game statistics A new scene to go to when the ship hits an asteroid

6 Sound Effects The library Cocosdenshion subproject of cocos2d-iphone targeted at game audio needs Sound effects can be loaded at application startup, so there's no delay during play

7 Sound Effects We added sound files to the 'Resources' Group (crtl-click → Add → Existing Files) Preload the .wav files in AsteroidsAppDelegate applicationDidFinishLaunching Play the .wav effects where needed iphone.org/wiki/doku.php/cocosdenshion:faq

8 Menus In the 'init' method of the AsteroidsScene Layer we:
created the menu, and it's items describe how they would be displated on the page Attach the menu to the Layer We also need to declare the selector method to process user interactions

9 Sprites & Actions A sprite is a 2d image integrated into a larger scene (from Wikipedia) They can move and appear to be in active (e.g, blink) We will tie the sprit into the physics engine so that it can “interact” with other objects iphone.org/wiki/doku.php/prog_guide:sprites?s[]=s prites

10 Tie in with physics engine
We subclassed CCSprite so that: The body and colission shape are created at init time The 'setPosition' method also tells the physics engine Delete the body and shape with the sprite is deallocated iphone.org/wiki/doku.php/prog_guide:sprites#how _to_subclass_sprites

11 Ideas of things to do Use more 'interesting' transitions between scenes Add sound when the flying saucer enters Have the flying saucer shoot missiles Remove the flying saucer when it hits an asteroid


Download ppt "Review Scene Management (Scene, Layer, Director) Sounds Menus"

Similar presentations


Ads by Google