Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
iOS Game Development By Example

You're reading from   iOS Game Development By Example Learn how to develop an ace game for your iOS device, using Sprite Kit

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher Packt
ISBN-13 9781785284694
Length 220 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Samanyu Chopra Samanyu Chopra
Author Profile Icon Samanyu Chopra
Samanyu Chopra
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. An Introduction to Sprite Kit FREE CHAPTER 2. Scenes in Sprite Kit 3. Sprites 4. Nodes in Sprite Kit 5. Physics in Sprite Kit 6. Animating Sprites, Controls, and SceneKit 7. Particle Effects and Shaders 8. Handling Multiple Scenes and Levels 9. Performance Enhancement and Extras 10. Revisiting Our Game and More on iOS 9 Index

Animating nodes


Animated pictures give a very dynamic and polished feel during a gameplay; it is always preferred to have animations in our game. To add animations in Sprite Nodes, we can use the SKAction class properties and methods, which add the animations to the Sprite Kit nodes. Let's discuss about the SKAction class in detail.

SKAction

Properties and methods of the SKAction class help in providing the actions to the nodes in a scene. Actions are used to change the arrangement and appearance of the node to which they are attached. Actions in a node are executed when the scene runs its nodes.

To assign an action we can call the particular SKAction class method as required. Then, we can configure the properties of the actions. In the end, for the execution of the action, we call the node object's runAction() method and pass the action's object.

Adding a single action to a node

There are two steps to add a single action to the node:

  1. Creating an action: First of all, we create an action which...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime