3. BattleBats
• From concept to app in 8 weeks
• Multiplayer version of a classic arcade game
• includes an editor for users to create and
share their own levels
• made entirely with SpriteKit!
Michael Burks michael@radtastical.com
7. SKActions
• are performed by SKNodes
• can do geometric transformations on
SKNodes
• can modify attributes of SKNodes
• can play sounds
• can run custom blocks
• can be combined into groups, sequences,
and repetitions
Michael Burks michael@radtastical.com
8. Physics!
• SKScene has an SKPhysicsWorld
• SKNodes can have SKPhysicsBodies
• SKPhysicsJoints can connect SKPhysicsBodies
Michael Burks michael@radtastical.com
9. SKPhysicsWorld
• controls (constant linear) gravity
• has methods to find SKPhysicsBodies at a
point, in a rect, or along a ray
• sends its delegate didBeginContact: and
didEndContact: methods
Michael Burks michael@radtastical.com
10. SKPhysicsBody
• is created with a shape
• has area, mass, density
• has friction, restitution, damping
• has velocity, angular velocity
• has bit masks for contact and collision
categories
• has methods to apply forces, impulses, and
torques
Michael Burks michael@radtastical.com
12. SpriteKit Run Cycle
• The scene calls its update: method.
• The scene executes actions on its children,
then calls its didEvaluateActions method.
• The SKPhysicsContactDelegate methods
didBeginContact: and didEndContact: are
called if appropriate.
• The scene executes physics simulation on its
physics bodies, then calls its didSimulatePhysics
method.
Michael Burks michael@radtastical.com
14. Pros
• It’s easy and fun! You can quickly turn a
concept into a prototype.
• It has everything you need - animation,
physics, and collision detection.
• It looks good and works well.
Michael Burks michael@radtastical.com
15. Cons
• SKNodes are subclasses of UIResponder,
not UIView. No gesture recognizers or
UIControls in an SKScene or SKNode.
• The background color of an SKScene is
opaque.
• SKLabelNodes only display a single line of
text.
• No built-in system for Newtonian inversesquare gravity.
Michael Burks michael@radtastical.com
16. Cons
• Running SKActions on SKNodes that are already
running SKActions can lead to unexpected
results.
• Elastic collisions aren’t always elastic.
• No visualization of SKPhysicsJoints.
• No simple way to set the equilibrium length of
SKPhysicsJointSpring.
• Changing the position of an SKNode doesn’t
always register immediately with its associated
SKPhysicsJoints.
Michael Burks michael@radtastical.com
18. Tips
1. Use SKSpriteNodes!
• Apple has done the most to optimize these.
• They are MUCH faster than SKShapeNodes.
Michael Burks michael@radtastical.com
19. Tips
2. Use the zPosition property to order SKNodes!
• This helps you keep track of where
SKNodes lie in the scene relative to
each other.
• This can also help the SKView
optimize drawing. Set the
ignoresSiblingOrder property of the
SKView to YES (new to beta 6).
Michael Burks michael@radtastical.com
20. Go make SpriteKit apps!
!
!
(if I can do it, you probably can too)
Michael Burks michael@radtastical.com