Workshop › Tower Defense › Step 33 of 42
Once the game is over, clicks no longer build towers and the tile under the mouse is no longer highlighted.
```js
function build(col, row) {
if (state === 'over' || !canBuild(col, row)) return
if (hover && state !== 'over') {
```|| means "or": build stops if the game is over or the tile cannot be built on.!== means "is not": the highlight is drawn only while the game is not over.build, change the first line to the new condition.draw, change if (hover) { to if (hover && state !== 'over') {.Skills: Game states, Keyboard and mouse input
← Out of lives The most waves survived →