aboutsummaryrefslogtreecommitdiff
path: root/src/game.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/game.zig')
-rw-r--r--src/game.zig22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/game.zig b/src/game.zig
new file mode 100644
index 0000000..fc64001
--- /dev/null
+++ b/src/game.zig
@@ -0,0 +1,22 @@
+const std = @import("std");
+const spoon = @import("spoon");
+
+const brothers = @import("brothers.zig");
+const playfield = @import("playfield.zig");
+
+pub const Game = struct {
+ brothers: [2]brothers.Brother = undefined,
+ character: ?brothers.Side = undefined,
+ pub fn draw(self: Game, rc: *spoon.Term.RenderContext) !void {
+ try playfield.draw(rc);
+ try self.brothers[0].draw(rc);
+ try self.brothers[1].draw(rc);
+ }
+ pub fn reset(self: *Game) void {
+ self.resetRound();
+ }
+ pub fn resetRound(self: *Game) void {
+ self.brothers[0].reset(brothers.Side.left);
+ self.brothers[1].reset(brothers.Side.right);
+ }
+};