Wednesday 25 March 2015

Adding a Highscore System to Our Game


This scorescript gives you a score when you kill the enemy.
For the brief we were told that the game had to have a high score element to it, So we wanted to give the player a sense of achievement. I put in a piece of code so that once you had killed the enemy, it would change the highscore, This is just to put it in place, so the high score doesn't actually change at this very moment.

The game manager holds the scorescript, the pauser and the levelload script.
I had created a game manager, which holds the in-game scripts, which menas that they will work throughout the game, when the trigger is activated. These scripts here mean that you can pause the game, it loads the level of the game and changes the high score.


This makes the highscore change when you do better than the previous player.
I then added in the HighScoreScript. the score will now change, depending on what you kill and will also change on the main menu. We decided in the end to give 100 points to the player for each kill that they managed to achieve. I felt that this was fair because if it was 10, the total will be too low for the player to feel a sense of achievement when they played the game.

The score has changed when I did better.
As shown above the score on the High Score menu has changed when I achieved better. If I had more time I would defiantly go in and add in player prefabs so that the score would save.


No comments:

Post a Comment