O
Orvais
Guest
Just been following a simple youtube tutorial on an experience script for an rpg I'm trying to make.
I'm curious if there is a way to have the remaining experience I have left over carry over to the next level?
Here is my script.
essentially when I collide with the object it gets destroyed and gives me 10 experience up to a max of 60 * the current level. What would I need to do to roll over remaining experience if I were to give it a higher number when I reach the max level up point?
I'm curious if there is a way to have the remaining experience I have left over carry over to the next level?
Here is my script.
Code:
//Create
t_level = 1;
t_exp = 0;
t_exptolevel = 60 * t_level
//Collission Event
with(other) {
instance_destroy();
}
t_exp += 10;
if (t_exp > t_exptolevel) {
t_level += 1;
t_exp = 0;
t_exptolevel = 60 * t_level
}