From 8f3d5310234bd88aed32a5441fad9fe4b16a8adc Mon Sep 17 00:00:00 2001 From: rdagger Date: Tue, 26 Mar 2024 23:37:21 -0700 Subject: [PATCH] Update demo animated sprite. --- demo_animated_sprite.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/demo_animated_sprite.py b/demo_animated_sprite.py index ce3c32b..47a3eef 100644 --- a/demo_animated_sprite.py +++ b/demo_animated_sprite.py @@ -36,8 +36,7 @@ def test(): offset = SIZE * index display.draw_sprite(mv_cat[offset: offset + SIZE], x, y, SPRITE_WIDTH, SPRITE_HEIGHT) - index += 1 # Increment sprite index - index &= 7 # Wrap sprite index on end sprite + index = (index + 1) & 7 # Next sprite index (wrap on last) # Attempt to set framerate to 30 FPS timer_dif = 33333 - ticks_diff(ticks_us(), timer)