tamamo/src/main.zig

26 lines
461 B
Zig
Raw Normal View History

2022-04-24 09:46:36 +00:00
const w4 = @import("wasm4.zig");
const smiley = [8]u8{
0b11000011,
0b10000001,
0b00100100,
0b00100100,
0b00000000,
0b00100100,
0b10011001,
0b11000011,
};
export fn update() void {
2022-04-24 13:01:28 +00:00
w4.m.colors._0 = .p1;
2022-04-24 09:46:36 +00:00
w4.text("Hello from Zig!", 10, 10);
2022-04-24 11:40:11 +00:00
const gamepad = w4.m.gamepads[0];
if (gamepad.x) {
2022-04-24 13:01:28 +00:00
w4.m.colors._0 = .p3;
2022-04-24 09:46:36 +00:00
}
2022-04-24 11:40:11 +00:00
w4.blit(&smiley, 76, 76, 8, 8, .{});
2022-04-24 09:46:36 +00:00
w4.text("Press X to blink", 16, 90);
}