Today in Ant’s lesson i continued working on my 2D game. The first thing that i did was create a system where if the player touches an enemy the level will restart. To get the code for this i watched the coding videos on the college moodle. As well as reacting to enemy collision, i also made it so that when the player reaches the goal (in this case the exit door) the collision will start the next level – i have yet to add anything to this level however.
After achieving this i decided to add projectiles to the enemies. Through a few scripts(‘autofire’, ‘projectile’), rigidbodies, and a bullet prefab, i managed to do so. The enemy chefs now throw knives, i like how the knives react to the environment – bouncing off walls/getting stuck. The level is also restarts when the player touches one of the knives.