Wrote initial game objects
This commit is contained in:
parent
d7ac70b78d
commit
b951f4de71
5 changed files with 243 additions and 0 deletions
38
src/playfield.zig
Normal file
38
src/playfield.zig
Normal 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 =
|
||||
\\████████████████████████████████████████████████████████████████████████████████
|
||||
\\█ ██ █
|
||||
\\████████████████████████████████████████████████████████████████████████████████
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\█ ██ █
|
||||
\\████████████████████████████████████████████████████████████████████████████████
|
||||
;
|
Loading…
Add table
Add a link
Reference in a new issue