1
0
Fork 0

Wrote initial game objects

This commit is contained in:
Julien Dessaux 2022-08-14 14:33:29 +02:00
parent d7ac70b78d
commit b951f4de71
Signed by: adyxax
GPG key ID: F92E51B86E07177E
5 changed files with 243 additions and 0 deletions

38
src/playfield.zig Normal file
View file

@ -0,0 +1,38 @@
const std = @import("std");
const spoon = @import("spoon");
pub fn draw(rc: *spoon.Term.RenderContext) !void {
var iter = std.mem.split(u8, field, "\n");
var y: usize = 0;
while (iter.next()) |line| : (y += 1) {
try rc.moveCursorTo(y, 0);
_ = try rc.buffer.writer().write(line);
}
}
const field =
\\████████████████████████████████████████████████████████████████████████████████
\\█ ██ █
\\████████████████████████████████████████████████████████████████████████████████
\\█ █
\\█ █
\\█ █
\\█ █
\\█ █
\\█ █
\\█ █
\\█ █
\\█ █
\\█ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\█ ██ █
\\████████████████████████████████████████████████████████████████████████████████
;