anywhereiroa
anywhereiroa
CC#
Created by anywhereiroa on 8/16/2023 in #help
❔ How to implement an "undo move" function in a game where I need to keep track of multiple objects?
@voflorian99 Thank you very much for your detailed answer! I will try to figure something out, your replies actually allowed me to try to look at the problem from a different angle. Thank you again!
10 replies
CC#
Created by anywhereiroa on 8/16/2023 in #help
❔ How to implement an "undo move" function in a game where I need to keep track of multiple objects?
That's exactly what I did for the player. But my concern is, when I keep track of multiple objects, will they be added to the stack not simultaneously but rather consecutively, if that makes sense? So or example, when I move one tile with the player, these happen at the same time: - Player changes position - Door opens - Block moves in opposite direction So the stack would have each 3 as different items, therefore when I undo, first the block would move to its original place, then the door would close, then finally the player would move back. The only idea that comes to mind is to have EVERY SINGLE OBJECT that I want to undo inside the same command, however I imagine that getting pretty hectic.
10 replies