summaryrefslogtreecommitdiff
path: root/src/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.zig')
-rw-r--r--src/main.zig24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig
index ea12f00..0bfbe60 100644
--- a/src/main.zig
+++ b/src/main.zig
@@ -9,6 +9,26 @@ pub fn main() !void {
});
defer z.deinit();
- try z.drawBegin();
- try z.drawEnd();
+ var score: usize = 0;
+ while (!z.shouldQuit()) {
+ z.cycleEvents();
+
+ if (z.getKey(.space) == .pressed) {
+ score += 1;
+ std.log.info("score: {}", .{score});
+ }
+
+ try z.drawBegin();
+ try z.drawSetColor(.{ .r = 1, .g = 0, .b = 1 });
+ try z.drawClear();
+ try z.drawSetColor(.{ .r = 0, .g = 0, .b = 0 });
+ try z.drawRectangle(.{
+ .x = 12,
+ .y = 25,
+ .w = 32,
+ .h = 16,
+ .fill = true,
+ });
+ try z.drawEnd();
+ }
}