Professional Documents
Culture Documents
Designing Games With Sprite Kit: Bringing Your Art To Life
Designing Games With Sprite Kit: Bringing Your Art To Life
Session 503
Norman Wang
These are confidential sessions—please refrain from streaming, blogging, or taking pictures
Sprite Kit Recap
■ Particles
■ Physics
■ Visual effects
SKScene
simulates physics
SKScene
-didEvaluateActions evaluates actions
The Adventure Game Loop
SKView Each Frame
renders the scene
-update:
SKScene
simulates physics
SKScene
-didEvaluateActions evaluates actions
The Adventure Game Loop
SKView Each Frame
renders the scene
-update:
-didSimulatePhysics
SKScene
simulates physics
SKScene
-didEvaluateActions evaluates actions
Adventure Assets Challenges
■ Background tiles
■ Environmental elements
1660
1500
1000
500
26
0
File Count
Adventure Textures Summary
90
2000 90
1660
1500 67.5
1000 45
29
500 22.5
26
0 0
File Count Pixel Count (MP)
Adventure Textures Summary
90
2000 90
1660
1500 67.5
1000 45
29
500 22.5
26
0 0
File Count Pixel Count (MP)
• Post processing
■ Image processing on
a given render target
■ Sprite Kit provides image
■ Flashes
■ Spawning
ScaleSpeed ZPosition
ZPositionRange
Scale
ScaleSequence
BlendMode
xAcceleration
Alpha
EmissionAngle
Size
Color
Speed
Rotation
Color Sequence
SpeedRange
PositionRange Action
Lifetime
Particle Editor
• Invoked by emitter
■ At time of particle creation
■ particleAction property
particleAction Example
• Parallax
• Collisions
• Particles
• Sprites
Parallax
-1 +1
root
object
-1
“Fake” 3D
+1
object
root
-1 +1
-1
Parallax
ps.fadeAlpha = YES;
Parallax
ps.fadeAlpha = YES;
Parallax
ps.fadeAlpha = YES;
Parallax
“tree_05c”
“tree_05b”
“tree_05a”
-(void)updateOffset:(SKScene*)scene
{
// Get the current scene position
CGPoint scenePos = [scene convertPoint:self.position fromNode:self.parent];
-(void)updateOffset:(SKScene*)scene
{
// Get the current scene position
CGPoint scenePos = [scene convertPoint:self.position fromNode:self.parent];
-(void)updateOffset:(SKScene*)scene
{
// Get the current scene position
CGPoint scenePos = [scene convertPoint:self.position fromNode:self.parent];
• How we made it
• Using physics
Collision Mapping
Collision Mapping
CGRect rect;
....
sprite.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:rect.size];
sprite.physicsBody.dynamic = NO;
sprite.physicsBody.categoryBitMask = kColliderWall;
[self addNodeToWorld:sprite atLayer:kLayerGround];
....
Lesson Two
Building Art
Art Pipeline
=
Texture Atlas
=
Particles
Particles
Result
Lesson Three
Agree on Stuff
Pipeline
• Communication
• Naming scheme
• Folder structure
• Coordinate system
• Orientation
Production
Project
Art
Sound
Data
Levels
Folder Structure
Project
Art
Data
Levels
File Names
File Names
Revision
Lesson Four
Have Fun
Lessons
OnContact
Custom Actions
Apply Impulse
OnContact
Custom Actions
Apply Impulse
Play “Dust”
Particle Effect
OnContact
Custom Actions
Apply Impulse
OnContact
Custom Actions
Apply Impulse
OnContact
Custom Actions
Apply Impulse
OnContact
Play SFX
Custom Actions
Apply Impulse
OnContact
Play SFX
Wait Two
Seconds
Custom Actions
Apply Impulse
OnContact
Play SFX
Apply Impulse
OnContact
Play SFX
Apply Impulse
OnContact
Play SFX
Allan Schaffer
Graphics and Game Technologies Evangelist
aschaffer@apple.com
Developer Documentation
http://developer.apple.com/library/
Related Sessions
Pacific Heights
Integrating with Game Controllers Tuesday 3:15PM
Presidio
Introduction to Sprite Kit Wednesday 11:30AM
Labs