Undo the step

Hi all,

I have made an interactive. I want to try that whatever user does in runtime i want to undo it on back button (that is Cntrl Z for each click or action).

How is it possible?

Any idea?

Please help
Thanx

make an array of size N, push into the array the actions of the player, (push as in, in position 1, the latest action) when the array fills up, discard the action at the end, when you want to “undo” an action, pop the 1st position of the array, move the positions 2 - N one position up, and then do whatever is necessary to “undo” that action.

how to check action of player ?? if start one invoke repeating it also can change ???

Well, your player has to do some action… right? So basically whenever he does something you simply add its state to the array. Whenever he presses a button or whatever else he does in your game… just add it to your array.

All you have to do is add a line of code to each action the player can do to add it to the array. But you have to write the line or function that does that yourself since we don’t know what exactly your player can do.