Even More Code

I knew when I was going into this that there was going to be a lot of coding but I’m not going to lie. I didn’t realise it was going to be this much. I have about 3/4 of my FPS, TopDown and Platformer sorted. But my turn based I’ve only got about half done if that, and at this point I am hating to see code. But I am continuing to push through to get this project done and hand it in hopefully on time.

FPS

This piece of code is used to align the camera with the mouse, this allows the player to move the mouse around and control the direction in which the player is facing.

This piece of code is used to help the player not only move around the environment using ‘wasd’ but also allows the player to jump and controls the weight of said jump.

This piece of script allows the user to interact with objects by shooting out a invisible beam that knows whether or not it is colliding with an interactable object. 

This piece of script allows the player to interact with doors and open them.

TopDownShooter

This is a simple piece of script which will be used on the enemies so that when the bullet hits them they disappear.

Platformer

This piece of code is used to control the ‘cinemachine’ and designate the boundaries that it shows and allows the player to enter.

This is a simple piece of code that controls that of the player, and makes it so that the sprite changes direction depending on the movements of the player.

This piece of code is used to control the enemy AI. This allows them to move side to side and detect where the floor is by projecting a invisible line down. It also gives the enemy a health value and allows the enemy to take damage and disappear once dead.

This piece of code is used to transfer the character from one world to another after pressing the ‘e’ key. Though it will only work if you’re in the invisible box created by the gizmo.

This piece of script allows the player to actually attack and sets the parameters of the attack range as well.

TurnBased

This piece of code allows us to set up and personally enter the stats of a enemy creature whilst also classifying it within a certain rarity and elemental type.

This piece of code also allows me to enter in stats but instead of it being for monsters it’s for the hero’s.

This piece of code is used to control the turn based itself. allowing the hero to choose an attack and allowing the enemy to choose an attack as well.

This second part of this code is used to assist with unity understanding which action is currently being done as well as what models need to move and be controlled. 

This script is used to control which action the enemy will commit as well as the speed and cooldown that the enemy possesses.

The rest of this script is used to move the enemy towards the hero it is attacking.

This script is used to control what state the hero is in and when it is that the hero will change state and what is needed to be looked at to determine that.