Tuesday 19 April 2016

Level-Up Mechanic

We wanted to amp up the gameplay within our game by including a level up system.
Changes to the game objects related to the player character, so from D6 to D8 is done through if statements. I create public game objects and assign the appropriate models to the variables. In the if statement, when the appropriate level is current the game objects contextual to the level will have their set active booleans set to true and false. For example at level 2 the D6 that the player starts with is turned off and the D8 is turned on and within the if statement the max dice roll value increases from 6 to 8.


All changes within the code work within if statements. I have access to the combat manager script and the health manager script made by Prem and with those references I can call the damage output for the Heavy and Light attack options, the max and current health values of the player and the random.range values to change the max dice roll value. Every level the base attack values of Heavy Attack and Light Attack (which start as 5 and 2 respectively) increase by 1 and 2 respectively. 

I also attempted to add perks within our game, the only perk I managed to implement was a health regeneration perk. Using if statements, from level 5 onward the player will regenerate hp over time, essentially every second. We realise that this may break the game in terms of balancing but we have rationalised that this being a vertical slice/demo we will allow the player this imbalance. For a full game release would limit this to only regenerate a set amount of hp every turn in combat.

above is where I have edited Prem's script to add the max dice roll value. This allowed me to change the int value of the max dice roll variable when I called it in my if statements in the level up script.

No comments:

Post a Comment