KIT207 ~ Self Study 4 (Part 1 ~ A Simple Game)
Starting off with a Key Lesson Learned: Always make a backup of your project whenever you plan on making a major step!!
At one point I was forced to enter my project in 'SafeMode' due to the project file containing errors and I have never felt so much fear of losing all my progress due to not backing up my project enough. Luckily I was able to troubleshoot implemented scripts and repair them before entering the project normally again but I can't stress enough how important it is to keep a backup!!
This weeks self study focused on creating a small game from previous portfolio work. This was the most challenging week encountered and my sleep schedule will never be the same after spending late night after late night to attempt to gain a deeper understanding of C#. Having the basis code provided assisted greatly in knowing which direction to go, especially in the case of the players health. I was hesitant to branch out from these, yet this was necessary for project growth. I had managed to connect the player health to the Unity UI system to update using numbers (converting the int value to a string) with corresponding health increase and decrease as I had attempted to utilise a slider for this unsuccessfully previously. Once the player health reaches 0 health the text ‘You Died:(’ appears to indicate the end of the game. My process for creating C# became write what I though may work from my understanding and work backwards from the errors until it functioned :)
Key Lesson Learned: It might look rough, but it can always be non-existent instead (there’s always a worse outcome) :)
(Figure 1: Enemy spawning via spawner and mouse clicks and the lowering of player health on enemy collision/destroy)
(Figure 2: Collection of health item and increase of player health in top left)
(Figure 3: End of game when player health reaches 0)
The enemies within the scene are destroyed after coming in contact with the player and the player health is decreased by one as an effect. Although the character models used for enemies are yet to be fixed as learning the C# coding process consumed majority of time for this week. I used the destroy object from a previous tutorial to build on for this area as it gave a general idea of how this concept was initiated with colliders for the enemy destroy and health item destroy. The end result was not optimal yet it functioned, which is more than expected (not every mouse click spawns an enemy for some reason). The spawner code provided was implemented across different points of the terrain and move towards the player on start. This is an area I would add a trigger to for more game functionality, where if the player moves too close to the area, enemies spawn.
Key Lesson Learned: Code talks and you must think in branches of where code may need to be to communicate :)
(Figure 4: Spawned enemy approaching player from other side of map)
A strange issue encountered was with an already place enemy as this was while I was working with creating the character version of the AI. For a reason unknown when the original is destroyed the game view is exited due to an error. The solution to this was a simple one... clone jail. The original enemy is no longer able to travel outside the specified corner of the terrain and therefore will never get destroyed. It's only choice is to sit there for eternity and think about their actions.
(Figure 5: Clone jail)
I feel I can finally rotate that door open from Tutorial 2 after this (reference Tutorial 2 post).
UTAS KIT207 Portfolio
~ kdierikx UTAS 2023 Portfolio Semester 2 ~
More posts
- KIT207 ~ Tutorial 5Aug 21, 2023
- KIT207 ~ Self Study 5Aug 15, 2023
- KIT207 ~ Self Study 4 (Part 2 ~ Game Ideas)Aug 08, 2023
- KIT207 ~ Tutorial 3Aug 07, 2023
- KIT207 ~ Self Study 3Aug 01, 2023
- KIT207 ~ Tutorial 2Jul 31, 2023
- KIT207 ~ Self Study 2Jul 25, 2023
- KIT207 ~ Tutorial 1Jul 24, 2023
- KIT207 ~ Self Study 1Jul 18, 2023
Leave a comment
Log in with itch.io to leave a comment.