Devlog #3 - Doing the undoing
Hey all!
Last update, I was working on path connecting, but I needed the previous tile placed so I pivoted to work on "undo"ing first! If I was storing my list of moves already, I could easily grab the previous tile placed.
Setting up the initial undo was easy - storing every tile placement in an undo_history array and reading it backwards / assigning the tile to the grid when I hit undo.
But after testing, I realized undoing a line of paths you just placed while clicking + dragging gets very tedious to undo one tile at a time.
Instead, I setup a multidimensional array storing every tile placement into it's own undo_stack array and then stored that undo_stack into the undo_history array.
If you single click, it's a single item array. If you drag + click, placing multiple tiles, it stores them all in an array until you release the mouse button.
Thanks for reading! Would love to hear your thoughts!!
Follow on twitch for Salamancy dev streams.
Follow on twitter for updates, game dev, and art.
- Tapsteady
Project Salamancy
Status | In development |
Author | tapsteady |
Genre | Puzzle |
Tags | Difficult, Isometric, Relaxing, Singleplayer |
More posts
- Devlog #7 - That's-olotl Salamanders56 days ago
- Devlog #6 - Rat in a Maze77 days ago
- Devlog #5 - (Ec)static Tiles84 days ago
- Devlog #4 - Forking Around95 days ago
- Devlog #2 - Be a good neighborJan 07, 2025
- Devlog #1 - Salamancy is born!Dec 31, 2024
Leave a comment
Log in with itch.io to leave a comment.