Cole Challenge is a 3D first-person survival puzzle game. This is my first solo game project made back in 2018 using Unity3D that encouraged me to pursue Game Development.
Design Development:
The challenges I’ve came across while building the game were mostly on the technical side. I had no previous experience with using Unity or C++ and it has been a tedious process of looking up solutions and samples from the web and tutorials before coding implementation can proceed and playtest can be done. One example of a problem I encountered was that the plane does not disappear after a certain amount of time with delay. But I’ve found some solutions to this from forum.unity.com and chose the simplest to be implemented it to my code as shown below.
The design of the game map and mechanics used went through several changes before it was finalized. The mechanics of the game was updated based on questionnaires on what players would want and find interesting in a game. The difficult part was to determine what I should include and exclude from the finalized game based off players input, given my limited time to do so.
After completing my first game, it has really motivated me to create my next game. It is challenging but satisfying when the codes finally works, design being implemented and to be able to visualize the final version of the gameplay itself and having players play the game at the end of the day.
My experience in creating a game from scratch was scary as first, as I’m not sure if I would be able to do it. There were many issues that arise during development, code errors, over-simplified boring mechanics, bugs with some objects, scene switching problems, lost files due to not saving and most of all deadlines.
Prioritizing my time on focusing on more important tasks and testing every single scene and action repeatedly before adding more details and visuals was something I learned during development which is super important and also saving the development progress as often as possible to avoid losing hours of progress.
Apart from this, I’ve learned animating objects, looping animation on objects through codes, adding colours and textures to objects, random sizing objects through codes, placing players at a certain coordinates in the game map (teleporting), enabling player mouse clicks, adding sound effects and background music, gathering feedback from players, having a playtest, acknowledging that development is not one off and updates are necessary to ensure players would keep playing and that players can spot a bug/glitch faster than the developers can.
Technical Development:
Portal Trigger Code
The first portal is the winning portal where players enter to finish the game once the objectives has been met. The second portal is a teleportation portal where players enter to be teleported into another game area.
The first tag applies to the first portal, "PORTALPLANE" is to trigger a text to let players know of their objectives in order to activate the portal.
The second tag applies to the second portal, "FIREWALL" is triggered when a player stepped into a new game area as a tip for players to use the portal to teleport into safety.
Mini Fireball Code
I wanted the fire ball to track the player and move towards them. So with transform.position specifically "target.position" it allows me to do that and apply it to the fire ball.
Fireplane Code
To identify the different planes I have used during development, I name this script "FirePlane" because this code is only applied to planes in the fire zone of my game.
I code the fire plane to only stay visible for a certain amount of time, in this case 5f, before it disappears and cause the player to drop into the fire.
Sound effect is also played when player step onto each fire plane.
Health Text Code
OnTriggerEnter is triggered when players first collide with the object;
First if-statement with tag "Fire" consist of a text warning and health damage to players.
Second if-statement with tag "FIREBALL" consist of the same actions as "FIRE" but with different text.
OnTriggerStay is triggered if players stays in the object;
Both if-statement provides different text warnings if this situation happens and it also deals heavier damage to players.
If players health goes below 10, it triggers a warning and if player's health goes less or equals to 0, load the Gameover scene.
IEnumerator is used to spawn a collection of functions.
Timer Countdown Code
A simple countdown timer, if timeleft is less or equal to 0, it loads the "Gameover" scene. In this case, player has 3 minutes to win the game.
Red Button Code
There are 2 buttons in the game, Portal and Fire button.
OnMouseDown function if the player mouse click on the button object it triggers the sound effects and change the color of the button object and for the Firebutton object it has another text because it is a button leading to another game area.
Player Controller Code
When players enters the teleport portal it triggers the "BOOSTER" tag and move the player to another area.
For the if-statement count < 6;
If a player tries to use the portal with less than 6 cubiecoin (objective token) it will trigger the text and a sound effect but if the count is >= 6 then it loads the player into the "Won" Scene.
When players pick up a cubiecoin, it displays a message following the count to reveal the player's progress in the game.
With SetCountText(), it allows me to update the UI for the CubieCoin counter.
Next Scene Code
A simple switching scene code, I wanted to add a short delay before scenes are loaded and I achieved that with StartCoroutine and IEnumerator.
Comments