This week I implemented a fuel system which controls the player’s movement and restricts them from being able to fly really high into space. This system ensures that players are forced to interact with the core gameplay loop of avoiding asteroids and slowly climbing higher. However, adding a fuel gauge and the need to manage how much fuel the player has available, added a new level of difficulty which quickly became overwhelming in initial playtests. To account for this, I needed to adapt the difficulty of the asteroids coming in by making them spawn less frequently. Changing this too drastically, however, resulted in the asteroids, and predicting their patterns, becoming less of a focus and the core gameplay became more about avoiding losing fuel. Therefore, any changes I made were minimal, and I made the fuel easier to manage by increasing the amount of fuel available to the player, thus the system helps to enhance the core gameplay loop.

To make the fuel system work, I added pickups that would refill the player’s fuel level by a specific amount, up to a preset limit. When adding these, I used a circle placeholder sprite, as I do not yet have any graphics for them. Initially, I programmed the game to spawn the fuel pickups randomly, but this resulted in them being too unpredictable and often spawn near asteroids; this forced the player to put themselves in danger to pick them up. This conflicts with the required predictability of the game, needed for the asteroids to work, and could cause the player to build unhelpful ways of dealing with patterns that are based on unpredictable fuel spawns.

Therefore, I implemented fuel pickups in the patterns at specific points. This is in accordance with the patterns I already planned out, such as the drops already planned in the ‘knockback’ and ‘kicker’ patterns, but these will now always be fuel pickups instead of fuel pickups or meteorite gems; meteorite gems will spawn at other planned points. I plan to incorporate a fuel drop in every pattern, so that the core gameplay loop automatically integrates fuel management if the player is doing well; though some pickups will be harder to get than others, potentially spawning offscreen, to reward experimentation and mastery.

To implement the fuel pickups into the patterns, I added a new number code for the array storing the position of the asteroids in the pattern. I already have an exit code, that being that if the script reading the positions finds a 100, it means that the pattern is over and the script should get a new pattern. I used a similar system for the fuel pickups: if the position number is greater than 200 then the game knows to spawn a fuel pickup, instead of an asteroid.

I also added a UI element that tracks the player’s current fuel level. This is an image UI component that fills up from the bottom. A script tracks the player’s fuel amount each frame, and divides that amount by the max fuel capacity variable to generate a value to set the UI component’s fill level to. The max fuel capacity variable is saved to the rocket, and is utilised to cap the fuel available to the player; the variable can be easily changed in the engine editor, and will likely change when specific modules are installed.

I was also able to get the game loading and running on a mobile device this week! To do this I need a Mac to build the game, as it converts it to Xcode for IOS. I also need to implement touchscreen support, to make the rocket go up when the touchscreen is pressed; the UI buttons already work fine on the touchscreen.

Finally, this week I also added indicators that appear at the sides, in-line with asteroids that are spawning in. These are spawned at the same time as the asteroids, so they spawn when the asteroids are offscreen, and give the player an early warning system. Right now, the indicators only stay on the screen for a second before the asteroid arrives, however, it feels like just long enough and makes gameplay much easier. The indicators delete themselves as soon as their specific asteroid arrives on the screen; this is based on the width of the main camera, rather than a specified time, so will adjust for all screen sizes. See the video below for a peek at everything in the game so far!

early UI.mp4