Module 4 - Simple Game Mechanics
Module 4
This module was fairly short and was simply adding some game like elements into the scene. The first thing I did was get the spawner working as I've worked with spawning things like this before so it's fairly easy to do. I just placed a few spawners in the level and used the script provided. To give the enemies a target to chase I made each spawner know about the player was and each time an enemy is spawned it is told what their target is.
Spawner spawning things
The next part was to add some health into the game and make the enemies die when they get to the player. This was also fairly simple as I simply needed to check for collisions with an enemy and then delete them and decrease the health value.I then created a simple text display for the health. I was curious to see how Unity dealt with UI in 3D but it's basically the same as 2D just a bit more awkward to use.
Losing health
I created a simple health pack using 3D cubes and made it rotate on the spot. It is essentially the same as a enemy except that it adds health instead of taking it.
Health pack
The final part was a simple game over screen for when the player loses all their health. This was just a script that when the player loses health changes some text in the UI to the "YOU LOSE". It also looks a bit weird because of the bootleg way I did a third person camera. A better way to do it is to use the Cinemachine plugins for unity but for the purposes of this exercise this version works fine.
Game over
KIT207 Portfolio
More posts
- Tutorial 5 - Cinemachine and Post-ProcessingAug 17, 2022
- Module 5 - Lighting and ShaderGraphsAug 16, 2022
- Game ConceptsAug 09, 2022
- Tutorial 3 - NavMesh and AI PathingAug 07, 2022
- Module 3 - Terrain and ProBuilderAug 02, 2022
- Tutorial 2 - Player MovementJul 31, 2022
- Module 2 - Modelling and AnimationJul 26, 2022
- Tutorial 1 - Simple SceneJul 20, 2022
- Module 1 - ModellingJul 19, 2022
Leave a comment
Log in with itch.io to leave a comment.