The next


The next what? The ambiguity of the post title fits, because picking "the next" is easy for a human, but weird in the code*.

Nonetheless, I present to you the "next" key. Press "n" to cycle around between the active units. When your selected unit runs out of turns, or you sleep ("z" key, remember?), the game automatically cycles to the next unit. I personally don't like that automatic cycling, so the next feature is going to be "n" key whether or not you have a selected unit, and I turn off auto-cycle.

Between the "z" and "n" keys, it's now trivial to build up a gigantic pile of tanks. It's so easy that I ran out of memory, and the web browser page crashed and reloaded. I need to add an upper bound on the unit count, as well as look for ways to slim down the memory on each unit.


Also, the code is getting too messy for my taste. I find myself search through by key word. For my own comfort, I need to add more objects, for instance an object to manage turns, an object to manage teams, etc. I haven't tried this in Godot yet, but I have a few ideas on how to do it with nodes + scene instances.

*  If coding is your thing, the nerdy details are in the code commit on Github.

Files

tankies-html5.zip Play in browser
Version 24 Jan 21, 2024

Leave a comment

Log in with itch.io to leave a comment.