Hi, this may be an obvious question to ask but can I assume everyone is using a similar technique for the timing of sprite anaimations...
for axample, I have a car based 2D driving game (top down) and every time a car bumps into the perimeter wall it causes a little cloud to appear.
The cloud has 10 frames of animation, then disappears. I have lots of little animations like this that can crop up during the game. The game has 4 cars, each of which can generate a cloud so...
Would I be right to assume everyone would assign a timer variable to each of the 4 clouds? The thinking being that once a cloud animation is triggered, each cloud has a timer which updates the animation frame ever 500ms ?
In my main loop, I check all timers like this:
If MilliSecs() - cloud1_timer >= 500 ; timer reached 500ms?
cloud1_timer = 0 ; stop timer
End if
Or is there a better way ?
for axample, I have a car based 2D driving game (top down) and every time a car bumps into the perimeter wall it causes a little cloud to appear.
The cloud has 10 frames of animation, then disappears. I have lots of little animations like this that can crop up during the game. The game has 4 cars, each of which can generate a cloud so...
Would I be right to assume everyone would assign a timer variable to each of the 4 clouds? The thinking being that once a cloud animation is triggered, each cloud has a timer which updates the animation frame ever 500ms ?
In my main loop, I check all timers like this:
If MilliSecs() - cloud1_timer >= 500 ; timer reached 500ms?
cloud1_timer = 0 ; stop timer
End if
Or is there a better way ?