Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Offset grouped animations

I have a group of sprites that are all the same in a loop. What would be the best way to offset each animation frame, so they all don't animate at the same frame.

like image 690
Robert Avatar asked Feb 24 '26 08:02

Robert


1 Answers

I set an index on the sprites, then used modulus to target every second sprite, and then used:

sprite.animations.next(frameNumber);

to offset the frame

like image 149
Robert Avatar answered Feb 27 '26 02:02

Robert