Workshop › Flappy-style Bird › Step 1 of 30
Tap to flap between the pipes. Velocity, gravity, game states, spawning obstacles and a frame-rate-proof loop.
The game is drawn on a tall <canvas>, 400 pixels wide and 600 high, with the id game. We find it from JavaScript
and ask it for its 2D context, the object that holds every drawing command.
```js
const canvas = document.getElementById('game')
const ctx = canvas.getContext('2d')
```document is the page; getElementById('game') finds the element whose id is game.const canvas = gives what was found a name, so later lines can use it.canvas.getContext('2d') asks the canvas for its 2D drawing tools; we call them ctx (short for context).Write the two lines under the three comment lines, then press Run.
Skills: Drawing on a canvas