Darkness Encoded (Progress Devlog 5)


Progress DevLog 5

Upgrade Scene | Upgrades | Currency

Overview

This week I work on the component that separates my game from a basic side-scroller to an in-depth experience. This week has been crazy, I did not anticipate the amount of work involved. Big thanks to Lindsay Wells and Lake Hopkins as I would not have been able to incorporate all of this within the week. In this devLog I will explain my complications and how I overcame otherwise we will be here all day.

The goals for this week:

•             take the player's distance and applies it to a distance travelled multiplier.

•             Use that multiplier and add it to the currency once the run has ended.

•             Disable and enable the rocket upgrade once the player has enough currency.

•             Minus the allocated amount for the upgrade from their currency.

•             Manipulate the player's speed and boosts in correlation to the upgrade.

Scripting | Global Variables | Singletons

Within most of the coding world global variables are typically frowned upon, this exactly was what I needed to use to make my game work… I am new to using singletons and global variables and I will admit at my first glance I didn’t understand them at all. The way the upgrade system is set up is in a separate scene. This means everything that was local to my gameplay scene would be a lot harder to access. Grabbing key components of that scene like the score and stored them in global variables so I could use them in the upgrade scene. This became very complicated very quickly as I would have to not kill the player's data at the end of the run so that must be made into a global variable as well.

All these variables made me must accommodate them in different ways. For this, I thank Lindsay for helping me with the master singleton script and explaining how it was all done this way to not avoid errors.

The Upgrade system is the hardest thing I have had to face with so many interlinked parts making it hard to debug when things went wrong. I have learnt from this mistake and in future I have a greater understanding of how not to have hard-coded links.

Currency

The Currency multiplier is taken from the UI meters on the screen. Simply a fancy counter that tracks the horizontal distance of the player. This is a simple way to get a real-time distance meter and is easily expandable as opposed to having a game object with a collider in the scene. In conjunction with the infinite background, it is possible to make the game endless if I choose. The Score then is stored in the currency field. This field has access to the player, and rocket button, and can be subtracted from. Once this was established it created a loop that with a few parameters in place, so you don’t have negative points makes the upgrades tillable.

This is something I always wanted from the initial concept of the game, multiple checkboxes that applied different levels of power-ups depending on cost. Fortunately, this is relatively easy to implement but I am leaving it for next week I am out of time.

Upgrade Buttons

So far when the player collides with the ground nothing happened, so I added a simple addition to my update method within my ‘SqusihyMovement’ to destroy the player and the animations. On collision, a button appears letting the player press the ‘Enter’ key to continue to the upgrade scene. I used a separate scene to display the button at the right time. Within the upgrade scene there are a few buttons, ‘Main Menu’, ‘Take Off’ and ‘Rockets go brrrr enabled’ (ignore the last name I will change it in final testing). The ‘Take Off’ button takes you to the next run of the gameplay scene, and the ‘Rockets go brrrr enabled’ does the list of all the dot points above.

Thoughts

This week was wild. I attempted to explain a few concepts involved in this week’s journey and as expected I was not prepared for the workload of this week. Overall, I have learned so much through the testing and trailing phases. I am disappointed that I was only able to get one upgrade accomplished as I planned for many more, yet the foundations are there which was the hardest steppingstone for me. Possibly if I have enough time, I can come back and make a few changes and iterations. the game is beginning to feel so close to completion and I am excited for what is to come.

Files

DARK.zip Play in browser
Jun 12, 2023

Leave a comment

Log in with itch.io to leave a comment.