Saturday 23 January 2016

Game Combat redesigned

After having a lot of stress and trouble with the set up of multiple enemies I redesigned the combat to house all the scripts on objects that wont be destroyed or deactivated:

The health manger - controls both the player and enemy health bars.

The Dice by the player (6 sided, 8 sided...) - controls the rolling and functions that deduct from health based on roll numbers.

The player trigger script on the player - this script controls the triggered events such as fights.

All three scripts communicate with each other to make the combat system work, for now the dice rolling is set to roll for both players, the numbers are then compared and the side with the lower number looses health, once the players health reaches zero the game over screen takes over, but should the enemy loose all their health the player is prompted to click the enemy to kill them.

With this system the boss fight could be easily done, the boss would have slightly different scripts 

No comments:

Post a Comment