Okay, I'm currently making a game, and the player has a level, and skills. What I want is for every 5 levels that the player gains, he gains a talent point that will effect one of his skills. Now I know that I could achieve this by doing a bunch of if statements, but I don't think that is the most efficient way to do it.
Here's an example off the top of my head:
I could easily implement it this way, but it seems redundant and kind of messy to say the least, and would also mean that there would be an eventual cap to talent points. What kind of counter could I implement to resolve this issue and make it more efficient?
Here's an example off the top of my head:
if(level == 5){ talentpoints++; } if(level == 10){ talentpoints++; }
I could easily implement it this way, but it seems redundant and kind of messy to say the least, and would also mean that there would be an eventual cap to talent points. What kind of counter could I implement to resolve this issue and make it more efficient?