Getting started with sprite-kit
Remarks#
SpriteKit is a 2D Game Engine developed by Apple. It provides high level APIs and a wide range of functionalities to developers. It also contains an internal Physics Engine.
It is available on every Apple platform
- iOS
- macOS
- tvOS
- watchOS (>= 3.0)
Note: If you wish to develop using 3D graphics you need to use SceneKit instead.
The core building blocks of SpriteKit are:
- SKView: a view in which SKScenes are presented.
- SKScene: a 2D scene that is presented in an SKView and contains one or more SKSpriteNodes.
- SKSpriteNode: an individual 2D image that can be animated around the scene.
Other related building blocks are:
- SKNode: a more general node that can be used in a scene to group other nodes together for more complex behaviour.
- SKAction: single or groups of actions that are applied to SKNodes to implement animations and other effects.
- SKPhysicsBody - allows physics to be applied to SKNodes to allow them to behave in a realistic manner, including falling under gravity, bouncing off each other and following ballistic trajectories.
Versions#
iOS 7.0 and Later
OS X 10.9 Mavericks and Later
watchOS 3.0 and Later
tvOS 9.0 and later
Your first SpriteKit Game (Hello World)
Open Xcode and select Create a new Xcode Project
.
Now select iOS > Application
on the left and Game
on the main selection area.
Press Next.
- Write into
Product Name
the name of your first great game. - Into
Organization Name
the name of your company (or simply your own name). Organisation Identifier
should contain your reversed domain name (www.yourdomain.com
becomescom.yourdomain
). If you don’t have a domain write anything you want (this is just and test).- Then select
Swift
,SpriteKit
andiPhone
.
Press Next.
Select a folder of your Mac where you want to save the project and click on Create.
Congrats, you create your first Game with SpriteKit! Just press CMD
+ R
to run it into the simulator!