Workshop › Battleship › Step 30 of 35
To play without a mouse, a yellow frame marks the square the keyboard is on.
```js
let cursor // { r, c } for the keyboard
cursor = { r: 0, c: 0 }
if (state === 'playing') {
ctx.strokeStyle = '#fde047'
ctx.strokeRect(SEA.x + cursor.c * BIG + 1, SEA.y + cursor.r * BIG + 1, BIG - 2, BIG - 2)
}
```cursor holds a row and a column; a new game starts it in the top-left corner.strokeRect draws only the outline) is drawn around that square.let showHeat, write let cursor; in reset, under showHeat = false, write the cursor line.draw, right after the loop that outlines sunk ships, write the if (state === 'playing') block.Skills: Drawing on a canvas
← Show their ships at the end Move with the arrows →