Skip to content

Commit

Permalink
Update Zig demo cart to use wrapper API
Browse files Browse the repository at this point in the history
  • Loading branch information
soxfox42 committed Jul 2, 2022
1 parent d848942 commit 4ede2e6
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions templates/zig/src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,23 @@ export fn BOOT() void {
}

export fn TIC() void {
if (tic.btn(0) != 0) {
if (tic.btn(0)) {
mascot.y -= 1;
}
if (tic.btn(1) != 0) {
if (tic.btn(1)) {
mascot.y +=1;
}
if (tic.btn(2) != 0) {
if (tic.btn(2)) {
mascot.x -= 1;
}
if (tic.btn(3) != 0) {
if (tic.btn(3)) {
mascot.x += 1;
}

tic.cls(13);
var trans_color = [_]u8 {14};
tic.spr(@as(i32, 1+t%60/30*2),mascot.x,mascot.y,&trans_color,1,3,0,0,2,2);
_ = tic.print("HELLO WORLD!", 84, 84, 15, true, 1, false);

// cls(13)
// spr()
// print("HELLO WORLD!",84,84)
tic.spr(@as(i32, 1+t%60/30*2),mascot.x,mascot.y,.{.w=2, .h=2, .transparent=&.{14}, .scale=3});
_ = tic.print("HELLO WORLD!", 84, 84, .{});

t += 1;
}

0 comments on commit 4ede2e6

Please sign in to comment.