Thus, the only thing I could do to calm the rising wave of "what if's" in my head was to write an orderly list of all the projects I'd like to tackle, and pick ONE that I can tinker with alongside my Citadel remake. It sounds like a plan - I hope by unconscious brain takes the hint.
* * *
Yesterday I sat down at the keyboard for the first time in over a week, in a vain attempt to get my enemies moving. One of the biggest issues with programming (for me, anyway) is knowing how to break a task down into logical steps. I'd been thinking - and possibly over-thinking - enemy movement and AI for the game, to the point where I had no idea where to start, or what the best approach might be.
In desperation, I'd Googled "enemy movement routines game maker", which ultimately led me to an excerpt from a Game Maker book, where they discussed enemies moving on a tile-by-tile basis (in other words, precisely what I need for Citadel). Key to the routine was the place_snapped command, which allows you to check whether or not an object is aligned to a grid.
After an hour or so at the keyboard (along with a puzzling period of 15 minutes where I was tweaking the code for an object but getting no results; it turned out that I was debugging the code for the wrong object, and naturally, much slapping of the head soon followed), my enemies were finally emerging from traps and chasing me, tenaciously, around the level.
Although some of the graphics will have to be re-imported to work with the grid snapping (essentially, changing the origins of sprites and adding some padding around their edges), the code is starting to take shape; I now have a clearer picture of how the AI/State machines will be structured, and once the movent routines are done I can then allow enemies to start shooting back. :)
