Learn iOS SpriteKit with Examples, Code Snippets and Video Tutorials

Stopping Scheduled Performers (or Selectors) in Sprite Kit

Stopping Scheduled Performers (or Selectors) in Sprite Kit
October 7, 2013 Justin

Similar to unscheduling selectors in Cocos2d, with Sprite Kit you might decide to cancel a method that was told to perform with a delay. For example, if this line was run earlier in your level class or game engine….

That line might have been called to move a game character to the left after a 2 second delay (kind of a long delay I know), but before the 2 seconds occurred, the character was killed, so you no longer need it to run the moveLeft method.  In which case, your level class can call…

 Update: After looking back on this post (one year later), its always better to use SKActions with game objects in Sprite Kit.

Justin Dike is the owner and lead developer at CartoonSmart.com. He's taught hundreds of hours of game development video tutorials, covering everything from coding to art. These days he's working mostly on Swift and Sprite Kit tutorials, which often lead into highly polished iOS / tvOS Starter Kits, which require no programming at all, but are capable of making nearly any type game! Yeah, you read that write. You can also find Justin at the official CartoonSmart Podcast

0 Comments

Leave a reply

Check out our premium Swift and Sprite Kit Tutorial content!

Visit CartoonSmart.com