Thursday, March 3, 2016

Healing script


The healing script is called from the health script. The player's healing is turned on and off over a period of time so the player will not die as quickly. We decided against using a base Health and just diminishing without healing because it tends to be frustrating to the character, since they feel like they cannot succeed very far in the level.

Health Script




For  the health script, I looked into using an intricate event system, but I found that getters and setters were effective since it is such a small game. Value is set in place for health and the damage and healing are controlled in separate scripts. Each instance checks to see if the player is dead or above the clamp amount.

Sound FX

Coding the Audio for the game posed an over lap issue. The only way the separate sounds would work together was if I implemented bools that stated when one sound could start and where the other would end. Only the continueShot clip (which is played while the user holds down the button on the headset), is continually looped.

NavMeshAgent


The Nav mesh agent is put on the enemies in order to use the nav mesh to move. The script targets the player as the desired location and moves to that position while avoiding the obstacles that may stand in it's way. 


Once implemented, I changed the stopping distance so the enemies would have to shoot from a certain distance away, instead of right on top of the player.

Since the Nav Mesh takes care of the enemy movement, I do not have to create a fleshed out AI system.

Nav Mesh





We plan on using Unity's nav mesh for our enemy API. Using the base offset, I can make the drones look like they are flying without having a collider beneath them that would take damage. To create some randomization, we may put invisible and visible objects that the enemy would have to move around, instead of walking in a straight line.