From 9c33714591a2147f7e5879e77212ca9886d0c967 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 25 Sep 2026 21:47:58 -0300 Subject: Put the game first: lib/sketchbook, sketches/vecanim The root is the game. The platform library moves to lib/sketchbook (with serve_web.py, which serves any sketch's web build, as a tool of it), and vecanim to sketches/vecanim, still its own package on the same library. --- test/counter_v2.zig | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 test/counter_v2.zig (limited to 'test/counter_v2.zig') diff --git a/test/counter_v2.zig b/test/counter_v2.zig new file mode 100644 index 0000000..7771470 --- /dev/null +++ b/test/counter_v2.zig @@ -0,0 +1,23 @@ +//! Reload fixture, second build: a new field, one gone, the rest moved. +const sk = @import("sketch"); + +pub const name = "counter"; +pub const width = 320; +pub const height = 200; + +pub const State = struct { + streak: u16 = 7, + label: enum(u8) { cold, warm, hot } = .cold, + clicks: u32 = 0, +}; + +pub fn update(state: *State, in: *const sk.Input) void { + for (in.events) |e| if (e.kind == .mouse_up) { + state.clicks += 10; + }; +} + +pub fn draw(state: *const State, f: *sk.Frame) void { + f.clear(0x302820); + f.print(8, 8, 2, 0xffffff, "clicks {d} streak {d}", .{ state.clicks, state.streak }); +} -- cgit v1.3