Hey there, i have a quiet simple question, it shouldnt be too hard, but im really struggling with it. I have build a leveling system, which itself works totally fine.
The enemy AI is based on a "state-variable", as example, 1 is idle, 2 is walking right etc. So if you kill an enemy, it's state is set to "dead" and you recieve experience points.
The enemies are all in a family called "enemies" and they are all handled as separate instances.
My problem now is, damage and states works fine for separate enemies, but when it comes to give experience points, my problem starts. My setup right now is like this. (I tried many many different setups)
For each - enemy
Health is >0
Set variable to "dead" and add points to variable "exp" for player
Now the exp points will be added continiously and i understand why, but i still couldnt figure out a legit way to just add exp points ONE time on enemies death.