Display scores
This commit is contained in:
parent
c9539b4cb4
commit
d6a8aead1d
1 changed files with 8 additions and 0 deletions
|
@ -34,6 +34,14 @@ pub const Brother = struct {
|
||||||
var y = @floatToInt(u8, std.math.round(self.y));
|
var y = @floatToInt(u8, std.math.round(self.y));
|
||||||
w4.DRAW_COLORS.* = 0x30;
|
w4.DRAW_COLORS.* = 0x30;
|
||||||
w4.blit(&brother, self.x, y - brother_height, brother_width, brother_height, brother_flags);
|
w4.blit(&brother, self.x, y - brother_height, brother_width, brother_height, brother_flags);
|
||||||
|
var buf: [3]u8 = undefined;
|
||||||
|
w4.DRAW_COLORS.* = 0x32;
|
||||||
|
_ = std.fmt.formatIntBuf(&buf, self.score, 10, .lower, .{ .width = 3 });
|
||||||
|
if (self.side == .left) {
|
||||||
|
w4.text(buf[0..], 0, 0);
|
||||||
|
} else {
|
||||||
|
w4.text(buf[0..], 136, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pub fn reset(self: *Brother, side: utils.side) void {
|
pub fn reset(self: *Brother, side: utils.side) void {
|
||||||
self.side = side;
|
self.side = side;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue