fix snake
This commit is contained in:
parent
de990f312d
commit
1643dca7a0
|
|
@ -90,13 +90,13 @@ export function draw(ctx: GameContext) {
|
||||||
for (const s of snake) {
|
for (const s of snake) {
|
||||||
ctx.rectfill(
|
ctx.rectfill(
|
||||||
s.x * CELL, s.y * CELL,
|
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"
|
"magenta"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
// score!
|
// score!
|
||||||
ctx.text(`Score: ${snake.length - 1}`, 5, boardH - 25, "cyan")
|
ctx.text(`Score: ${snake.length - 1}`, 5, boardH - 18, "cyan", 12)
|
||||||
|
|
||||||
c.restore()
|
c.restore()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user