The fourth game I made for the Game Design and Prototyping module was Gemstone Grab, a platformer game.
EXPLORATION OF IDEAS
With this project, I wanted to challenge myself by combining the challenging elements that I had included in my previous games, such as a restart mechanic, audio, the ability to earn score and then improve on that by including animation.
In contrast to the darker themes of my last game, Warehouse War, I wanted to keep the game feeling light and cheerful. Using the Simplified Platformer Pack by Kenney (Kenney, 2018), I was able to create a small area for the player to run and collect gemstones as the main goal.

NEW FEATURES
One of the new elements that I wanted to include was animation. With games such as Business Builder and Space Survival, I wanted to keep the overall complexity of the features included relatively simple whilst I was learning Unity’s engine and C# scripting, whereas Warehouse War was from a top-down view which made animating a challenge.
As Gemstone Grab is from a 2D side view, I could implement simple animations. As an example, I could make the player’s character model run when the movement keys were held, jumping when the spacebar was pressed and subsequently land after they had finished jumping. I used a YouTube tutorial by Blackthornprod titled “MAKING RUN, IDLE & JUMP 2D GAME ANIMATIONS – UNITY TUTORIAL” to learn about creating animation states for the player’s character model and how to call upon these states through my C# script (Blackthornprod, 2019).
I used the information from this tutorial to help with animating elements of my game. As mentioned above, I was able to create animations for the player running, jumping and landing through Unity’s animator window, with transitions between states to create fluid animation. As an example, in the image below, the player can move from the idle state where they are not moving to the running state upon a movement key being held, which changes the animation that the player’s model carries out. Upon the player releasing the movement key, the player can transition from the running state back to the idle state, as they are no longer moving and no longer require the running animation.

I also decided to animate the gemstones that the player has to collect to challenge myself further. I made 10 separate animations for the respective gemstones, taking inspiration from how the collectable rings in Sonic the Hedgehog gently rotate to provide the level with a playful feeling.

IMPROVING AND SCRIPTING
One aspect that I wanted to improve upon was the inclusion of sound and audio into the game. In my last game, Warehouse War, the only audio that I included was the track “Dead Home” by SavannaMusic from the site Pixabay that looped for as long as the player was alive. The mood of the track was dark and scary, which matched the theme that I was aiming for when creating the game.
In Gemstone Grab, I wanted to improve on this. I used the track “Delay” by Monkey Warhol from the site Free Music Archive as the mood of the track was light, but also had elements of Electronic and Synthesizer which I felt matched the game (Free Music Archive, 2021). I made the track loop and attached the audio to the camera, as the track was only 53 seconds long and a player might be in the level for longer than the initial length of time.
I also used one of the audio clips that were recorded as a part of the Introduction to Game Audio module and edited it using Adobe Audition to become the sound that played when the player collected one of the gemstones. I increased the overall volume of the clip by 10 decibels to allow the player to hear the collection noise alongside the audio that is playing, as the original volume level of the clip was very faint when compared to the audio track.

I also followed Alexander Zotov’s YouTube tutorial titled “How to add sound or audio effects SFX to Unity 2D arcade game | Very simple Unity 2D Tutorial” on how to call upon sounds at specific points in the game (Zotov, 2017b). As it was my first time using audio assets that were not attached to the game camera, I needed to create a system to manage to call upon certain sounds.
The script below is the Sound Manager for the game, which can access audio sources from a Unity folder titled “Resources” when specific measures are triggered. In this instance, the edited audio clip that became the sound for collecting the gemstones is only triggered upon the player’s collider hitting the collider of the gemstone; It then checks the tag to make sure that the player is colliding with the gemstone and then activates the section of the script.


In this project, I wanted to use an amalgamation of elements from my previous games, such as the player respawning, the player being able to gather a form of score and having the camera track the player upon the character model moving on horizontally or vertically.
I knew that I wanted to include the camera tracking feature from Warehouse War, as it allowed the player to interact with a larger playable space freely rather than the gameplay being restricted to a static view. The camera tracking script was easy to replicate from Warehouse War and made it so that the camera will always follow a target that has been specified, which in this case was the player, on any axis.

I also made it so that the player can respawn in three ways in Gemstone Grab – If they fall off the map, if they collide with a section of the map that is dangerous (spikes, water or lava) and if they press the restart button upon finishing the game.
I made an out of bounds boundary by utilising the script that I had created for Space Survival to detect if the player had fallen off the map. The script that detected if the player had fallen off the map utilised an if statement that detected collisions with any object that was tagged as “Player”, which would then reload the scene by calling upon Unity’s SceneManagement to load the scene again and set their score to 0; This was then attached to a 2D cube that had a larger width than the level itself and a box collider to detect when the two objects were touching.
In a similar manner, the player could also have the level reset if they collided with the dangerous objects of the level (water, lava and spikes). This was done by using the same if statement as mentioned above in a new script titled EnvironmentKill and polygon colliders to match the various shapes of the dangerous objects instead of having a collider that did not match the shape, such as having a box collider for triangle spikes.




In this project, I wanted the game to have an end. Business Builder and Space Survival were created to be endless while Warehouse War can be simplified down to how many points can the player obtain before being captured. Using Alexander Zotov’s YouTube tutorial “Making Unity 2D game. Make enemy collide with player and kill him | Simple UI Unity 2D tutorial”, I was able to implement a restart button and a congratulations message upon the player collecting all the gemstones (Zotov, 2017c).
I also wanted the gameplay to have somewhat of a competitive feel to it. Using the same tutorial by Alexander Zotov that I had used in both Space Survival and Warehouse War, I created a score counter to display how many gemstones the player had collected, which subsequently increased when the player collided with another gemstone (Zotov, 2017a). To add another competitive aspect, I also created a timer by following the YouTube tutorial “Create TIMER and STOPWATCH in your game! – Unity tutorial” by Coco Code (Coco Code, 2021); The inclusion of the timer allowed the player to see how fast they could collect all the gems across the level and aim to obtain the best time that they can, implementing challenge into the gameplay.

CHALLENGES
One of the challenges that I faced during this project is related to the animation of the gemstones. As mentioned in the above paragraphs, I wanted to challenge myself with this project by including new elements such as animation and proceeded to animate the gemstones in the level.
The first gemstone that the player interacts with was animated to rise and fall, so it appeared to be hovering above the terrain. I was happy with how it appeared and proceeded to make duplicates of the gemstone item in Unity’s hierarchy, which unbeknownst at the time was a large part of my issue; If I pressed play in Unity’s game view, all of the duplicate gemstones would seemingly disappear aside from the first initial gemstone, which upon collision with the player’s collider, would provide the player with more points than what the gemstone was worth.
This issue was incredibly confusing but after a long time of investigating through my C# scripting and Unity’s interface, I discovered what was happening. The animator controller for the first gemstone was linked to a specific location on the x and y-axis, meaning that any duplicates of this specific gemstone from the hierarchy also had an animation controller with that location, regardless of where I would place them. This was fixed by creating new animations for the 10 gemstones so that each gemstone had its own location on the x and the y-axis and was not being forced to group into one specific location.

Another issue that I had was the endgame screen constantly being visible. I made use of the same section of C# script that controlled the end game state in Warehouse War to do the same for Gemstone Grab, setting the game over text and the restart button to be hidden at the start of the game and to be displayed if a condition had been met. This did not work, however, as the text was constantly visible whilst playing. Upon further discovery, the if statement that controlled the end game state did not work. The end game would be called upon the player collecting 1 gemstone rather than all 10 gemstones, despite the if statement stating for it to be called on only when the score is at 10 or higher..
This issue was incredibly confusing and I had to rework this section of my game in order for the player to be able to end the game; I removed the if statement seen below, which was to trigger upon the player’s score counter being greater or equal to 10 gemstones, in favour for the player triggering the endgame by reaching a specific point on the right-hand side map, which would trigger upon the player colliding with a specific object. This fixed the issue of the endgame screen constantly being shown whilst playing the level – allowing the player to progress through the level without their view being blocked by the end game state.

The if statement that was to trigger on the players score being equal or higher to 10 gemstones.

The player triggers the endgame screen through detecting a collision with an object.
I also had issues with the timer in Gemstone Grab. The timer that I created would start as intended upon the game being loaded, but would not stop. The two boolean states of the timer were “stopwatchActive = true” and “stopwatchActive = false”, which would turn the timer on and off respectively – Despite my best efforts, the false state for the timer would not trigger. I could not make references to the timer script in other scripts, I could not stop the timer upon checking the tag of an object, I could not get the timer to stop by any means. I plan to try and fix this issue for my January assignment, as this issue was more so to polish the aesthetics of the game off rather than something that is stopping the player from playing the game.
OUTCOME
Overall, I am very pleased with how this game turned out, encapsulating the challenging elements of my previous games such as calling upon audio, using scene management and then improving even further by having the players character model animated along with the gemstones that the player had to collect.
The game has a method in which the player can win, the player can challenge themselves through the inclusion of the timer to obtain the best time for gathering all the gemstones and if the player falls, they can try the level again.

Itch.io link to Gemstone Grab: https://rjusher.itch.io/gemstone-grab
Referenced Material:
Blackthornprod (2019) MAKING RUN, IDLE & JUMP 2D GAME ANIMATIONS – UNITY TUTORIAL. www.youtube.com. Available online: https://www.youtube.com/watch?v=FTxQKHG5WCA&t=814s [Accessed 12 Nov. 2021].
Coco Code (2021) Create TIMER and STOPWATCH in your game! – Unity tutorial. www.youtube.com. Available online: https://www.youtube.com/watch?v=HLz_k6DSQvU&list=LL&index=6&t=509s [Accessed 14 Nov. 2021].
Free Music Archive (2021) Free Music Archive – Monkey Warhol – Delay. freemusicarchive.org. Available online: https://freemusicarchive.org/music/Monkey_Warhol/voyageur-ep/delay [Accessed 12 Nov. 2021].
Kenney (2018) Kenney • Simplified Platformer Pack. kenney.nl. Available online: https://kenney.nl/assets/simplified-platformer-pack [Accessed 12 Nov. 2021].
Zotov, A. (2017a) How to add a score counter into your Unity 2D game| Easy Unity 2D Tutorial. www.youtube.com. Available online: https://www.youtube.com/watch?v=QbqnDbexrCw&list=LL&index=21&t=126s [Accessed 14 Nov. 2021].
Zotov, A. (2017b) How to add sound or audio effects SFX to Unity 2D arcade game | Very simple Unity 2D Tutorial. YouTube. Available online: https://www.youtube.com/watch?v=8pFlnyfRfRc.
Zotov, A. (2017c) Making Unity 2D game. Make enemy collide with player and kill him | Simple UI Unity 2D tutorial. www.youtube.com. Available online: https://www.youtube.com/watch?v=JC59tDg4tmo [Accessed 14 Nov. 2021].