add animation
This commit is contained in:
parent
6fac39990b
commit
b00b4e3eac
Binary file not shown.
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user