My tank game is now over 3mb so i cannot share my project im signed up to github but dont have a clue how to use it so for now i have just print screened it.
Anyway i have a timer for the enemy to shoot (Reload speed) but if i create more than one instance of the enemy they all use the same timer, therefore only 1 enemy can shoot at any 1 time.
Im just wondering if their is a way to create a timer of each instance created. Heres what i got anyway
Hi, as it seems that you know how object variables works, it will be easy
Instead global timers, use object variables as instance timers
The expression “TimeDelta()” returns the time elapsed since the last frame, then for every enemy (without conditions), do:
No conditions || Do + TimeDelta() to the variable TimeSinceFire of Enemy
The variable TimeSinceFire will be increased as a timer (in seconds), now you can test the variable, and it will work for every instance, per-instance
Variable TimeSinceFire of Enemy is > Enemy.Variable(FireRate) || Shoot and Set variable TimeSinceFire of Enemy = 0