hi
i have a problem at the time of update a variable y attach a image for more infoā¦
so what i want is get the life of all my archer and civilians and put it in a variable called max life, this variable will sall me how much life i have for all my populationā¦
and when a enemi atack me modify mi Current Life variable but no modify My Max Life until some archer or civilian dieā¦
where im failing is a the moment of update mi current lifeā¦
example some enemies attack me and substract life to my current life⦠but when i buy a archer or civilian it reset the life to all the life of archer and civilian
let say the life of a archer is 100
let say if i have 2 archer = 200 lifeā¦
some enemie atacck 200-50(damage) = 150life
buy some archer current life wwill be like 3*100=300-50 dagame= 250 current life
but what happen is in set all life to 300 instead of 250
i belive is something in the way i seting and updating my current life⦠and or my max life⦠but my logic is on vacations =/
its not a profecional game is just practice
sorry for my bad english and maths⦠and logicā¦
thank you all