Planet Clicker by Galaxy117 (itch.io)
For my first 2D game in Unity we looked at creating our own version of a cookie clicker game, since there is no character all of the elements that I used to create my game in Unity were UI elements. I decided to think outside the box in terms of design by going for a space theme for my clicker game, the idea was that you would hire astronauts and explorers to explore worlds that are habitable to grow a population.
The objective of a ‘clicker’ game is to click on a cookie and gain points that can be spent on upgrades that either automatically generate cookies or add the number of cookies the player earns per click. they may include improvements for the upgrades that affect the efficiency or speed the of the affected upgrade.
Setup and User Interface:
To start with I laid out the positioning of the buttons and other elements that would make up the UI and base for the game, I created some buttons and a border that were added at a later time. these buttons were designed so they would fit with the theme of space and where easy to use and see. i added a drop shadow to some so the stood out against the background and border.
I chose to use the colour grey as it stood out from the multicoloured background and gave a metallic /space theme to the UI.
Scripting:
Increment total per click:

For the first script, I needed to make sure that when the button is clicked by the user the score goes up by 1, the score then needs to be displayed and incremented so it doesn’t overwrite the score and just stays as 1. the first thing I did was add ‘using UnityEngine.UI’ as that tells the game engine that we are using UI elements and allows it to access to the UI elements.
then I declared the variables that I would need ammountPerClick is the only one that needs a float value as it sets the value of 1 to be added every time the button is clicked, the other variables will start at 0 as that is the base value. amount per click is declared as a float rather than an integer due to the upgrades we add later.
First Upgrade – increase per click:

I then added the first upgrade that the player can purchase once they have reached a certain value. the if statement checks if the value that the player has is higher or equal to the price of the upgrade, if that is correct then it will minus the price of the upgrade from the player total. it will then update the price of the upgrade by multiplying it by the 1.75, it will then round that to the nearest whole value
Second Upgrade – auto increment total:
For the next upgrade the game would auto increment the total value by a certain amount every second. It makes use of a lot of the same code as the previous upgrade so there are some similarities.

It starts by declaring the variables that will be used and then sets the base price and current price values as weel as the auto incrementing value. this will refresh those values whenever the game is restarted. It will also minus the value of the upgrade from the players total and then increase the starting price by 2.5 as it is a more valuable upgrade then the previous.
At the bottom is code linking to a textbox underneath all of the upgrades that displays the upgrades name, details and price when the mouse hovers over the upgrade button, once the mouse moves off the button the text will disappear. all of the upgrades have this code.
Extra Details:
Using the UI elements, I created I imported them into the game and moved the buttons around and added their new look compared to the basic unity button style. I also added a placeholder background that I will update before the final version is posted and downloaded a text pack to go with the sci-fi theme of the game.
FMOD:
I had trouble integrating FMOD with Unity, but I will still add a few varying sound cues for when buttons are pressed in game and some backing music for the final version. I did get some help through the team’s chat to solve some of the issues I had.
The button sounds where sounds that I recorded and added later into the project along with a looping backing music.
Possible Improvements:
I thought I would show some of the ideas and possible additions to the game I thought of adding to my cookie clicker.
Updated Button:
I did look at a modified button and created a button that was a planet for the main button the user would press, usually in a cookie clicker there is a cookie in the center of the screen. I decided to create a planet that would sit at the bottom of the screen. However, when I added it to the game the button did not work so I decided against adding it, I would have also liked to add some little icons for each button to go along with the text to add something different.
Upgrades:
In some cookie clicker games you can purchase upgrades to improve the upgrades. theses basically improving an aspect of the related upgrade to improve efficiency and increase the player score quickly. Usually, they are more expensive than some of the higher upgrades. If this where something I would add I would have to edit the multipliers and power of some of the higher upgrades to add a bit of a gap where these improvements would become worthwhile additions to the player. they would need to relate to the script of the upgrade they are meant to improve and increase the effect of that upgrade by a relative value. they would then need the same code to increase the price to purchase that improvment.