Hello everyone!
So I have been teaching myself a bunch of coding and working on various sample projects that accomplish particular tasks. My latest one deals with leveling up a character, giving points based on level ups, and then when you hit max level you reset the character to 1 and give bonus attribute points.
To see the project visit: Unity WebGL Player | CharResetTest
The link to download the unity project is at the top of the page.
What the project entails:
- PlayerStats class for holding the player stats/level/attributes
- Function for Leveling Up
- Function for Bonus Calculation on regular level up
- Function for Bonus Calculation with overload on max level
- Returning a string with the stats information
- Private variables for all stats
- get/set functions for setting/getting the variables so you don't directly change the values of the variables directly. (Not publicly visible to any other part of the program)
- Displaying the information by calling the function from a separate game object, onto a TextMesh GameObject component
Instructions are included onscreen on how to use it, but:
Spacebar levels you up.
If you have points to spend, pressing A increases Strength by 1, S increases Dexterity by 1, D increases Intellect by 1.
If you like this, let me know if there is any particular type of system you are wanting to know how it works, and I will see if I can make something and put it up here for you to learn from
*Note: Also working, MySQL + bCrypt + Unity communication project, that I am currently in the process of writing functions for requesting and putting information to and from the database from within the game. (Like user login information).