Support our Sponsors:
Reply
 
Thread Tools Display Modes
  #1  
Old 06-21-2014, 12:42 PM
Prashant Prashant is offline
Junior Member
iPhone 4, iOS 7.x
 
Join Date: Jun 2014
Posts: 2
Default Spritekit undo move

Anyone familiar with spritekit?
Can some one tell me how we can keep a track of user moves? And how to add an undo move feature in spritekit?

Been looking all over the internet for this but no luck.
Reply With Quote
  #2  
Old 06-21-2014, 05:36 PM
Voley Voley is offline
Member
iPhone 3GS, OS 4.x
 
Join Date: Aug 2010
Posts: 50
Default

Quote:
Originally Posted by Prashant View Post
Anyone familiar with spritekit?
Can some one tell me how we can keep a track of user moves? And how to add an undo move feature in spritekit?

Been looking all over the internet for this but no luck.
Check out gameprogrammingpatterns.com - very useful book.
You need a "Command" design pattern.
Basically you create an object for every move and send it to your control code. Each command can also have equivalent undo object as either field in itself, or a separate object.

So this way when you want to undo you just tell your control code to execute undo on last command.
Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Copyright 2012, TouchArcade.com, LLC.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Copyright 2008 - 2011, TouchArcade.com. Privacy Policy / DMCA Copyright Agent