- Home /
Undo'ing a checkers move,Undoing a move
I'm currently making the undo button for a checkers game. If I move a piece, is there a generic method to just reverse the function that moved the piece or will I have to write one?
Just checking before I do so, all replies are appreciated,I'm currently making the undo button of a checkers game. If I click on a piece to move it from one place to another, is there a generic undo function that allows me to reverse the movement or will I have to write my own?
Just asking to check, thanks for any replies
Answer by jackmw94 · Mar 07 at 09:57 AM
You will have to write your own.
If you have a class representing a 'move' then store these in a stack since the last-in-first-out behaviour is exactly what you want for getting and setting undone moves.
Your answer
Follow this Question
Related Questions
Catch a unity undo/redo event. 2 Answers
Editing and Undo for non-unity properties 2 Answers
How to deal with 100 UI text elements displayed as a grid and sharing same event logic 2 Answers
How to perform Undo from script to restore component data? 0 Answers
How to use the Undo snapshot system? 3 Answers