Hey, hope this is the right spot to post!
I'm working on a turn based 2-player game where the state of the board is saved into a huge array.
The End Turn function creates a temp array, adds all the elements of the board array into it in reverse (so all the p1 assets reverse with p2) and then wipes the original board adds the temp array back in.
This temp array sticks around, so the undo function would just do this last part again: wipe the board and make it into the temp array which hasn't been altered since the last turn change.
My problem is that the temp array keeps pace with the board! Undoing essentially does nothing... anyone ever have a similar problem? anyone make a game with a similar mechanic I could peek at the code for?
Thanks!



Your temp table might be referencing the board table instead of copying from it, or vise versa.
https://www.lexaloffle.com/bbs/?pid=36979
[Please log in to post a comment]