fix snake

This commit is contained in:
Chris Wanstrath 2025-09-28 18:35:02 -07:00
parent de990f312d
commit 1643dca7a0

View File

@ -90,13 +90,13 @@ export function draw(ctx: GameContext) {
for (const s of snake) {
ctx.rectfill(
s.x * CELL, s.y * CELL,
(s.x + 1) * CELL, (s.y + 1) * CELL,
((s.x + 1) * CELL) + .5, ((s.y + 1) * CELL) + .5,
"magenta"
)
}
// score!
ctx.text(`Score: ${snake.length - 1}`, 5, boardH - 25, "cyan")
ctx.text(`Score: ${snake.length - 1}`, 5, boardH - 18, "cyan", 12)
c.restore()