add animation

This commit is contained in:
bQUARKz 2026-03-20 17:34:10 +00:00
parent 6fac39990b
commit b00b4e3eac
Signed by: bquarkz
SSH Key Fingerprint: SHA256:Z7dgqoglWwoK6j6u4QC87OveEq74WOhFN+gitsxtkf8
2 changed files with 19 additions and 1 deletions

View File

@ -7,10 +7,28 @@ import { Gfx } from @sdk:gfx;
fn frame() -> void
{
let touch = Input.touch();
let tile_id = 0;
let hold = 0;
let counter = 0;
if (touch.button().down())
{
hold = touch.button().hold() / 6;
while (counter < hold)
{
counter = counter + 1;
tile_id = tile_id + 1;
if (tile_id > 7)
{
tile_id = 0;
}
}
}
Gfx.clear(new Color(6577));
// Gfx.draw_square(touch.x(), touch.y(), 16, 16, new Color(65535), new Color(13271));
let sprite_status = Gfx.set_sprite(0, 0, touch.x(), touch.y(), 0, 0, true, false, false, 0);
let sprite_status = Gfx.set_sprite(0, 0, touch.x() - 16, touch.y() + 8, tile_id, 0, true, true, false, 0);
let sprite_status2 = Gfx.set_sprite(0, 1, touch.x() + 16, touch.y() + 8, tile_id, 0, true, false, false, 0);
let a = 10;
let b = 15;