I’ve been working on a new feature called interactive debugÂ that will be available inÂ the next release of Flixel Community.Â It’s a plugin activated whenÂ the debug overlay becomes visible.Â ItÂ allows developers to interactively move and change elementsÂ while the game is running. Before showing the new feature in action, let me explainÂ why it was developed.
When makingÂ a game, I tend to spend a significant amount of time tweaking things. For instance a level is usually not good at first,Â becauseÂ the player is unable to overcome someÂ obstacles (theyÂ are too high or theirÂ gap is too big). I fix that by following an extremely boring workflow: tweak something, compile, open the game, walk the player’s character to the right place, test, then repeat everything again. I can optimize that workflow by hardwiring the player’s character at the right place,Â but I just removed a single task from the list. I still need to go back and forthÂ from the IDE to the game to make things right.
Sometimes I just want to test the enemy AI, but the player’s character isn’t at the right spot, or the enemy is at the wrong place, and so on. I got tired of all that and decided to implement something that allow me to change things while the game is running. I call it interactive debug. When it is active, developers can choose tools to change the game elements, e.g. the pointer tools is used to select things, while the tile tool is used to change tilemaps.
BelowÂ are some gifs showing my progressÂ related to this feature. This is an early preview and just a few things are implemented, but it’s possible to have an idea of what is coming. The first tool is the Pointer, which can be used to selected elements on the screen. Anything that has a position (x and y properties) can be selected:
After an element is selected, it can be moved using the Move tool:
Â Sometimes it’s useful to remove an element from the screen, so the Eraser tool comes in handy. Just press Delete and all selected elements will be removed from the screen (interactive debug calls
kill() on them). It’s also possible to permanently remove elements (from the memory) by pressing Delete while holding Shift:
Finally the Tile tool allows a developer to modify any tilemap on the screen. Right now it’s possible to edit just the first tilemap found in the state’s display list, but that will change in the future:
Â I have more tools and ideas planned, such as Rotate, a property inspector and the ability to save any changes made during the interactive session. You can follow my progress by watching issue #206 in the Flixel Community repository on Github. I think this new feature will drastically improve the workflow of all Flixel developers.