Workshop › Connect Four › Step 18 of 38
Discs will fall instead of appearing. So play no longer changes the board: it creates falling, a disc on its way down
that knows its target row. land() finishes the move: the board changes and the turn passes.
```js
let falling // the disc on its way down, or null
falling = null
function play(col) {
if (falling || dropRow(col) === -1) return
const row = dropRow(col)
falling = { col, row, who: turn, y: -CELL / 2, vy: 0 }
}
function land() {
const { col, row, who } = falling
board[row][col] = who
falling = null
turn = 3 - turn
}
```falling is null ("nothing") when no disc is falling; if (falling || ...) refuses a move while one is.{ col, row } is short for { col: col, row: row }. The disc starts half a cell above the canvas with speed 0.const { col, row, who } = falling takes those three fields out into names. land puts the disc on the board.let turn write let falling; in reset, under turn = 1, write falling = null.play as shown and write land under it.Skills: Game states