If Frame<1 Then
Frame :+ 1
EndIf
If Frame>0 Then
Frame :- 1
EndIf
If Frame is 0, then the first if will change it to 1, and the second one will change it back to 0. Since you only have two frames, I would suggest using something like:
And by the way, you should use a timer for everything in the game, otherwise it'll depend on the FPS. Very simple to make, add this before the loop:
And this inside the loop to update it:
TimeDif should be a parameter in the "UpdateState" method.
Frame :+ 1
EndIf
If Frame>0 Then
Frame :- 1
EndIf
If Frame is 0, then the first if will change it to 1, and the second one will change it back to 0. Since you only have two frames, I would suggest using something like:
If Frame = 1 then Frame = 0 else Frame = 1
And by the way, you should use a timer for everything in the game, otherwise it'll depend on the FPS. Very simple to make, add this before the loop:
CurrentTime = MilliSecs()
And this inside the loop to update it:
TimeDif = MilliSecs() - CurrentTime CurrentTime = MilliSecs()
TimeDif should be a parameter in the "UpdateState" method.