I'm not sure how many people are familiar with it, but I'm using App Game Kit from The Game Creators, the same company behind DarkBASIC, to create the base engine for a really simplistic game. I won't get into too much detail about the game now, but suffice to say it should be a fun one to program!
One of the features of the game is going to be a built-in level editor which will allow the player to create their own unique levels. It will be fairly easy to implement, as the editor is basically going to be its own program in a separate included file, which will store map data in an array that the main engine will be able to use. I love building level editors, but there are a few things I realized player's would want in one.
- A GUI System (while I'm comfortable using keys and text, players will want buttons)
- Undo/Redo Funcionality
First, I'm creating a custom type to store metadata in, then declaring two global arrays based on the type. Whenever an action is performed, I call a function which will record the action into the undo stack. Whenever someone undoes the last action, it will copy the information from the current element of the undo stack into a new element of the redo stack (say all of this ten times fast, I dare you! ).
In order to keep memory usage down, there will be a limit of 50 undo/redoes available. But the really good thing about this system will be just how customizable it is, if the user wants to record other types of data, all they have to do is add the necessary information to the custom metadata type.
I know there are much better ways to handle something of this nature, but this was the best solution I could come up with and I'm sticking to it! Anybody here use AGK that might be interested in it?