RoboKiller – Cookie Clicker Clone
The first game I made as part of my course is a clone of Cookie Clicker, which I themed about robots. Being the first game, this was also my first introduction to creating a game and unity too. We were given video tutorials we could follow which helped a lot in getting used to unity and how it works. Fortunately, I found unity somewhat easy to use.
The assets I used in the game were drawn by me on my drawing tablet in Photoshop, so it wasn’t just clicking blank buttons like in the tutorial. There are two upgrades in the game, fire will raise the count overtime and guns will just improve the amount per click. To add the assets to unity, it was simple as all you needed to do was to drag a sprites folder containing them into the assets tab, and then drag the sprites you wanted to use into the source image tab, as seen below.
The first step I did to create the game is making a c# script called scr_scripting.
The script is fairly basic, as it changes a piece of text UI (Which shows the number of robots killed.) in the scene by adding how many robots per click the player is at to the total it is at when the button is pressed.
After the clicking script was working, I moved on to the upgrade scripts, starting with the script to kill more robots per click and show what the upgrade does.
The script compares the current amount of robots to how much the cost of the upgrade is, and if you have enough, it will subtract the price, increase the power of the upgrade, and increase how many robots you get per click and round it too so that the UI looks more clean.
It also changes the price and shows the upgrade information once you hover over the button with your mouse using the OnMouseEnter and OnMouseExit triggers.
The event trigger below is for showing or hiding the upgrade information depending on if a mouse is over it or not.
The next two scripts are for the Auto Kill Robots upgrade. The first script is almost identical to the previous script, with a few changes such as setting the price to a higher number through multiplication because its a more valuable upgrade.
The other script is what actually controls the AutoKillRobots upgrade, which controls the steady increase of robots.
This script is made to add robots automatically with a coroutine. The coroutine adds the current power of the upgrade to the current total every second.
Overall I think my first attempt at using unity was a success as I made a functioning clone of Cookie Clicker. It’s definitely not the most fleshed-out game, but as a prototype, and experimenting with unity, I thankfully got more comfortable with using the software. As I continue getting more and more familiar with unity, I will be able to create more and more complex features I will be able to make my own ideas come to fruition.
If I were to go back and add more to this game, I would make more upgrades available, and add some animations and sounds that give the player some sort of feedback to improve the experience.