not sure what you mean by "one animation number" but you can set LastFrame to whatever you want, whenever you want. people "initialize" and handle their objects & data in different ways but, one method would be to utilize an array to hold pertinent data you could use to reference and compare. if you wanted to store "lastframes" for a number of objects, let's say 10 for now, your array (and "initialization") might be something like:
`set up an array
dim EnemyInfo(10,2)
` we'll store enemy HIT flag info in EnemyInfo(X,1) and enemy animation LastFrame #'s in EnemyInfo(X,2).
`initialize array values
for Enemy = 1 to 10
EnemyInfo(Enemy,1) = 0 `not hit
EnemyInfo(Enemy,2) = TOTAL OBJECT FRAMES(Enemy)
next x
now you've stored each object's last animation frame and intialized their HIT flag to 0 (not hit).
then when you want to check for damage on a particular enemy, you'd use the array, blending it into the code example from above. ie, for object 3 in your example...
if state=2
LOOP OBJECT 3,2527,2590
if OBJECT FRAME (3) = EnemyInfo(3,2) and EnemyInfo(3,1) = 0
health = health -1
EnemyInfo(3,1) = 1
else
EnemyInfo(3,1) = 0
endif
endif
i can't really guess what your game is all about or how complex it might be but if you have multiple objects/entities/etc, you could use arrays like this to store all "entity" information including their current "states", health, last animation frames, HIT flags, etc.
make sense?