urmhhh... update a variable on the fly? ^^
well, i was just wondering if it's possible to update a variable without using additional code?
here's the situation: i have a large numbers of values (variables) included in an array:
Code:
// LOAD EVENT
strenght=10
magic=20
life=50
whatever = xxx
//
char["power"] = [stenght, magic, life, whatever]
imagine now i hit some enemy using my strenght value:
Code:
// enemy looses life
_root.enemy.life -= char["power"][0]
here, the enemy will lose 10 points.
NOW, what if the strenght value was changed during the game?
ex: strenght +=10
if i check again with the char["power"][0], the value will still be 10, because it was calculated in a load event.
and my question is: is there a way to update that variable into the array without launching a function that reload and recalculate the entire array? (they are more complex in my game)
maybe something more or less magical, like char["power"][0].update()? ^^
note; of course, i can fix it by using some if statments, or recalculate the array with a function, but i was just wondering if such a small code exists.
thanks...