Posted April 05, 2024 by Linkyboy26XA
The next study that took place across the Easter holidays required the addition of more game-like features to the tourist scene.
The first task was to create a spawner, which could produce endless amounts of enemies. This was created in a similar fashion to the enemy prefab with referral to other game objects and targeting the player. When attached to a moving object, the enemies can come from differing locations.
The next task was to have enemies deal damage to the player. By simply adding the provided code and linking the correct object references, the trigger detection script can easily incorporate this functionality. Afterwards I also implemented a safety (or invulnerability) period to prevent immediately sequential damage.
The third and final addition to this task was to create a healing item that would restore health back to the player. I decided a block of chocolate would be the most thematic, in more ways than one funnily enough. I found an applicable model on PolyPizza (another suggested 3D model site), made some minor modifications to it in Blender, and imported it into Unity. Reused and altered scripts from the enemies and their spawners formed the main components of the chocolate and what was to be a chocolate spawner, but unexpected issues prevented its completion. After a bit more messing around, I had a restorative and holy chocolate bar.
Here is a brief recording of some complete, albiet heavily compressed, gameplay.
Overall, I enjoyed implementing and extending these features further, and am looking forward to the team project in the coming weeks.
Chocolate by Jeremy on PolyPizza