2026-03-24 13:42:37 +00:00

44 lines
844 B
Plaintext

import { Color } from @core:color;
import { Log } from @sdk:log;
import { Input } from @sdk:input;
import { Gfx } from @sdk:gfx;
fn frame() -> void
{
let touch = Input.touch();
Gfx.clear(new Color(6577));
Gfx.draw_square(touch.x() - 8, touch.y() - 8, 16, 16, new Color(65535), new Color(13271));
let a = 10;
let b = 15;
let total = a + b;
if (Input.pad().a().pressed())
{
total += 25;
}
else if (Input.pad().b().pressed())
{
total += 5;
}
else if (Input.pad().x().pressed())
{
total -= 10;
}
if (total == 30)
{
Log.info("30 is the magic number!");
}
else if (total == 50)
{
Log.error("50 is the magic number!");
}
else if (total == 15)
{
Log.warn("The magic number is neither 30 nor 50!");
}
}