From d8b2c10c3ecddca9039015a7a49ff5fc82a7fdfb Mon Sep 17 00:00:00 2001 From: rdagger Date: Tue, 26 Mar 2024 23:20:01 -0700 Subject: [PATCH] Update demo animated sprite. --- demo_animated_sprite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/demo_animated_sprite.py b/demo_animated_sprite.py index 4aa711c..ce3c32b 100644 --- a/demo_animated_sprite.py +++ b/demo_animated_sprite.py @@ -36,7 +36,8 @@ def test(): offset = SIZE * index display.draw_sprite(mv_cat[offset: offset + SIZE], x, y, SPRITE_WIDTH, SPRITE_HEIGHT) - index = (index + 1) % 8 # Set current index + index += 1 # Increment sprite index + index &= 7 # Wrap sprite index on end sprite # Attempt to set framerate to 30 FPS timer_dif = 33333 - ticks_diff(ticks_us(), timer)