PROJECT: TFP SDCOM – 4

Some fairly good progress again this week, and am pleased to say that I took care of the remaining items from the previous to-do list. Namely, displaying the player’s remaining reloads and a reload indicator.

I’m particularly pleased with the indicator. The initial draft used Godot’s theme-based node, ProgressBar. After hooking it up in GDScript with one line of code, the progress bar increased, as expected, as the timer progessed.

Here’s that code:

get_node("ProgressBar").value = (wait_time - time_left) * 200

The “200” magic number will have to change as it only fits the current framework of the reload taking half a second (and fitting the progress bar’s range of 0 to 100).

But the vision was for a radial progress indicator. So, earlier today, I finally figured out the TextureProgress node. This one takes textures (or sprites, in my case) and allows you to construct a standard progress bar or a different kind. The trick was simply having the sprites loaded into the node – a “Top” sprite (for say, the case of a watch), a “Bottom” sprite (like the watch face) and a “Progress” sprite (the filling material). Setting it to clockwise fill and, it worked as envisioned.

Also noteworthy to mention, I had my first refactoring this week as well, thanks to the reload label (i.e. the text that tells you how many reloads you have). Initially, I had the Player control the missile directly, mouse-clicking to send the missile on its way. But it made communicating with the reload label awkward, a new missile was created regardless of what the reload label displayed.

So, I refactored the controlling code to the player’s launcher (a cut and paste job, really). Then, it was a simple signal hookup from the reload label to the launcher. Now, if you’re out of ammo, no new missile is created.

For next steps, I’ve included forward progress implementations for the game as well as some nice to have items.

Next Steps:

  • Simple stage leveling system
    • with a textual indicator
  • Weather system
    • Sunny day (i.e. what I’ve been doing)
    • Partial clouds
    • Overcast
  • Radar system
  • Art:
    • Create clouds
    • Update city explosion (looks awkward with the clipping)
    • New launcher (not a silo, I’ve decided)
    • New font

See you next time!

Published by dcgrapher

I like writing, drawing, Geography, gaming, programming, running, and cats. My family is awesome.

Leave a comment