Presentation is loading. Please wait.

Presentation is loading. Please wait.

Course Summary Xcode & iPhone Simulator

Similar presentations


Presentation on theme: "Course Summary Xcode & iPhone Simulator"— Presentation transcript:

1 Course Summary Xcode & iPhone Simulator
Objective-C & Foundation Framework Class Simple Scene Management (Cocos2d-iPhone) Sound Effects Sprites & Actions Particles Chipmunk Physics (Space, Body, Shape, Constraint) Collisions (using CP) Cocos2d & CP integration (Physics Engine Class Tie-in) Tables & Cells

2 Xcode & iPhone Simulator
Xcode: various windows, structure of project, console window (debug output), how to find a definition (Command Double Click) Simulator: separate executable, has limitations

3 Objective-C Class definition (@interface, @implemention)
Protocol definition Life Cycle Methods (Alloc, Init, Dealloc) Reference Counting (Retain, Release, AutoRelease) Dynamic vs Static typing Class & Instance methods (e.g. singleton design pattern)

4 Foundation Framework Classes
Mutable & Immutable Classes Strings (NSString) Arrays (NSArray) Associative Arrays (NSDictionary) Property Lists (NSPropertyListSerialization)

5 Simple Scene Management
a layer has the size of the device screen it defines appearance and behavior a scene is composed of one or more layers app transitions take place through scenes the director takes care of transitioning between scenes.

6 Simple Scene Management
typically one scene is used for the “playable” part of the game others scenes for: title, high scores, options runWithScene tells director to use that scene replaceScene replaces the running scene with another pauseScene puts the current scene on hold for another

7 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

8 Sprites Actions/Particles
Revisit the 'flying saucer' sprite: Implement Chipmunk Physics collision feedback with missiles and asteroids Use the particle system to give the impression that it has blown up, and play a 'boom' sound as well

9 Chipmunk Physics There are 4 basic objects:
Space holds the other 3 objects. Body holds the properties (mass, position, rotation, velocity, angular momentum, etc) associated with a physical object. Shapes attached to a body; defines the surface boundaries of a body for collision purposes; also the friction and elasticity. Constraints define the type of interactions that bodies can have.

10 Collisions Collisions are defined as talking place between two shapes
Handlers can be defined to be called when: Begin: two shapes just started touching Are: can get back collision force End: two shapes just stopped touching Callbacks are used in removing objects during a collision.

11 Physics Engine Class Tie-in
By subclassing CCSprite so that: init method will create the collision body and collision shape setPosition method will also tell the physics engine the position of the sprite dealloc method will also remove the physics body and shape when the sprite is deallocated

12 Physics Engine Class Tie-in
Registered a collision handler add code in the collision handlers and step: method to remove the flying saucer use the particle system to show a display when it was removed play some sound

13 UITableView API A table view is an instance of the UITableView class. Created given... an area on the screen, and A table style. Rows are created using cells that are UITableViewCell objects. Two Protocols are used: Data Sourse: to provide data used to populate the table Delegate: to managing the appearance and behavior of the table (e.g., headers, footers, reorder cells)

14 UITableView Protocols used
Remember: A protocol specifies a behavior through the inclusion of methods in the implementing object. UITableViewDataSource Protocol has two required methods: Number of rows in selection Cell for row at index path UITableViewDelegate Protocol Has no required methods.

15 Table Cells A Data Source method returns a cell object for a visible row. Cells can contain: an image or text content. The Table Cell object has methods that: manage cell selection, editing, accessory views, and cell configuration.


Download ppt "Course Summary Xcode & iPhone Simulator"

Similar presentations


Ads by Google