What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is...

73
© 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple. #WWDC15 What’s New in SpriteKit Tim Oriol Norman Wang Tyler Casella Graphics and Games Session 604

Transcript of What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is...

Page 1: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

© 2015 Apple Inc. All rights reserved. Redistribution or public display not permitted without written permission from Apple.

#WWDC15

What’s New in SpriteKit

Tim OriolNorman WangTyler Casella

Graphics and Games

Session 604

Page 2: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

What is SpriteKit?

Page 3: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

What is SpriteKit?

2D graphics framework for gamesSuper easy to useLets you design your game in the most natural way possibleAutomatic access to the latest and greatest

Page 4: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

What is SpriteKit?Supported across iOS and OS X

Page 5: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

What is SpriteKit?Xcode integrated live editor

Page 6: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

New Additions

Page 7: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Viewport

Page 8: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Viewport

Page 9: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKCameraNode

Represents the center of the viewportSKScene propertyMove the camera not the worldStatic elements can be moved with the camera

Page 10: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKCameraNode

SKCameraNode is a SKNode• Actions• Constraints• Rotation• Scale

Page 11: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKCameraNode

SKCameraNode is a SKNode• Actions• Constraints• Rotation• Scale

Page 12: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKCameraNode

SKCameraNode is a SKNode• Actions• Constraints• Rotation• Scale

Page 13: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKCameraNode

SKCameraNode is a SKNode• Actions• Constraints• Rotation• Scale

Page 14: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKCameraNode

SKCameraNode is a SKNode• Actions• Constraints• Rotation• Scale

Page 15: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKAudioNodePositional audio

Leveraging AVAudioEnginePosition calculated via node positionListener node property on SKSceneCreate with filename or URLFull control via avAudioNode property

Listener

SKAudioNodeSKAudioNode

Page 16: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKAudioNode

Page 17: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKAudioNode

Listener

Page 18: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKAudioNode

Listener

SKAudioNode

Page 19: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKAudioNode

Page 20: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKAudioNode

Page 21: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

References and Instancing

Leverage the NSCoding capabilityInstances of SKAction and SKNodeReusable componentsShare across multiple projects

Page 22: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SKReferenceNode

Place reference nodesBundle based filename or any URLEditor supported

SKReferenceNode

SKReferenceNode

SKReferenceNode Serialized SpriteKit File

Page 23: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Named SKActions

Create in XcodeShare and reuse action files

[SKAction actionNamed:]

[SKAction actionNamed:duration:]

SpriteKit Action Files

Page 24: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Playback control actionsplay, pause changePlaybackRateTo: duration: changeVolumeTo: duration:

Normal texture animationanimateWithNormalTextures:

New SKActions

Page 25: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Playback control actionsplay, pause changePlaybackRateTo: duration: changeVolumeTo: duration:

Normal texture animationanimateWithNormalTextures:

New SKActions

Page 26: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Playback control actionsplay, pause changePlaybackRateTo: duration: changeVolumeTo: duration:

Normal texture animationanimateWithNormalTextures:

New SKActions

Page 27: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

System Integration

Page 28: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Metal Backed

iOS and Mac Metal backed on devices that support itOpenGL on systems that don'tZero action required for developersAll SpriteKit apps automatically upgradedSKShaders automatically upgraded

Page 29: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

We Speak Swift and Objective-C

Nullability enhancementsObjective-C genericsEnhanced type safety

Page 30: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SceneKitSKTransitions

Use SKTransitions in SceneKitSceneKit Metal supportAutomatic context matching

Page 31: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitStep up your game

Entity/Component systemsState machinesAgents and behaviorsPathfindingAI strategistsRandom sourcesRule systems

Page 32: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Pathfinding operates on a navigation graphGraphs are collections of nodesNodes are joined by connectionsEach connection has an associated cost

A

B

C

D

Page 33: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Page 34: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Page 35: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Page 36: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Page 37: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Page 38: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Page 39: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitPathfinding

Page 40: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitAutomatic graph generation

If you’re using SpriteKit, we have provided a set of functions to automatically generate these from existing SKNodes.PhysicsBody, texture, or bounds.

[SKNode obstaclesFromNodeBounds: nodes]

[SKNode obstaclesFromNodePhysicsBodies: nodes]

[SKNode obstaclesFromSpriteTextures: nodes accuracy: accuracy]

Page 41: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitAutomatic graph generation

If you’re using SpriteKit, we have provided a set of functions to automatically generate these from existing SKNodes.PhysicsBody, texture, or bounds.

[SKNode obstaclesFromNodeBounds: nodes]

[SKNode obstaclesFromNodePhysicsBodies: nodes]

[SKNode obstaclesFromSpriteTextures: nodes accuracy: accuracy]

Page 42: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitAutomatic graph generation

If you’re using SpriteKit, we have provided a set of functions to automatically generate these from existing SKNodes.PhysicsBody, texture, or bounds.

[SKNode obstaclesFromNodeBounds: nodes]

[SKNode obstaclesFromNodePhysicsBodies: nodes]

[SKNode obstaclesFromSpriteTextures: nodes accuracy: accuracy]

Page 43: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

GameplayKitAutomatic graph generation

If you’re using SpriteKit, we have provided a set of functions to automatically generate these from existing SKNodes.PhysicsBody, texture, or bounds.

[SKNode obstaclesFromNodeBounds: nodes]

[SKNode obstaclesFromNodePhysicsBodies: nodes]

[SKNode obstaclesFromSpriteTextures: nodes accuracy: accuracy]

Page 44: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsNorman Wang

Page 45: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsIntroduction

Games rely on tools for iteration and scalability• Game logic, animation, or art assets

Improve work flow and build game fasterFocus on building the gameplay

+

Page 46: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsTexture atlas

cave_base.pngcave_destroyed.png

minionSplort.png

big_tree_base.png

big_tree_top.pngcave_top.pngbig_tree_middle.png

Page 47: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsTexture atlas

Page 48: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsTexture atlas

Page 49: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsTexture atlas in Asset Catalog

Page 50: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsTexture atlas with On Demand Resources

Page 51: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsTexture atlas with On Demand Resources

Page 52: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsParticle editor

Page 53: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsParticle editor

Page 54: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsXcode Quicklook

Page 55: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsXcode Quicklook

Page 56: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit Tools2D editor

Full visual editor for 2D games No more compile and checkNo code requiredVisual layoutLive physics simulationLive shader editing

Page 57: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit Tools2D editor

Full visual editor for 2D games No more compile and checkNo code requiredVisual layoutLive physics simulationLive shader editing

Page 58: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsNew features

More editor features this year• Custom classes• Camera• Audio node• Reference node

Increased collaboration and reusability

Page 59: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsNew features

More editor features this year• Custom classes• Camera• Audio node• Reference node

Increased collaboration and reusability

Page 60: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsNew features

More editor features this year• Custom classes• Camera• Audio node• Reference node

Increased collaboration and reusability

Page 61: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsNew features

More editor features this year• Custom classes• Camera• Audio node• Reference node

Increased collaboration and reusability

Page 62: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsAction editor

All new action editorTimeline basedRealtime preview2D and 3D supportCinematic and Interactive animations

Page 63: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsAction editor

All new action editorTimeline basedRealtime preview2D and 3D supportCinematic and Interactive animations

Page 64: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsReferences and instancing

Instances of SKAction and SKNodeReusable componentsData-driven modelShare across multiple projectsSeparate resource filesNo code required

Page 65: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsReferenced actions

Create once, reuse on multiple nodes, projectsReference via editor or codeLeveraging the new SKAction actionNamed: Build a custom library of actionsBuild very complex actions

Page 66: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsReferenced nodes

Create once, reuse on multiple nodes, projectsReference via editor or codeLeveraging the new SKReferenceNode APIBuild a custom library of nodesShare between multiple scenes, and projects

Page 67: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

SpriteKit ToolsReferenced nodes

Create once, reuse on multiple nodes, projectsReference via editor or codeLeveraging the new SKReferenceNode APIBuild a custom library of nodesShare between multiple scenes, and projects

Page 68: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

DemoBuilding a SpriteKit game

Tyler Casella

Page 69: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Summary

Exciting year for SpriteKit developers• Audio node, Camera node, Reference node, Reference action• All new timeline based action editor• Asset Catalog integration• App Thinning • On Demand Resources• Metal integration• GameplayKit integration

Page 70: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

More Information

SpriteKit Documentation and Videoshttp://developer.apple.com/spritekitApple Developer Forumshttp://developer.apple.com/forumsDeveloper Technical Supporthttp://developer.apple.com/support/technical

General InquiriesAllan Schaffer, Game Technologies [email protected]

Page 71: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Related Sessions

Going Social with ReplayKit and Game Center Mission Wednesday 1:30PM

Enhancements to SceneKit Mission Wednesday 2:30PM

Introducing GameplayKit Mission Thursday 11:00AM

Deeper into GameplayKit with DemoBots Mission Thursday 1:30PM

Page 72: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your

Related Labs

SpriteKit Lab Graphics B Wednesday 11:00AM

Game Controllers Lab Graphics D Thursday 2:30PM

GameplayKit Lab Graphics B Thursday 2:30PM

SpriteKit Lab Graphics C Friday 10:00AM

Page 73: What’s New in SpriteKit - Apple Inc....Graphics and Games Session 604 What is SpriteKit? What is SpriteKit? 2D graphics framework for games Super easy to use Lets you design your