Workshop › Wolfenstein-style 3D Maze › Step 3 of 18
The 3D view needs a ceiling (the top half, dark) and a floor (the bottom half, lighter). They also wipe the old picture each frame. A loop redraws everything about 60 times a second.
```js
const H = canvas.height
ctx.fillStyle = '#1e293b'
ctx.fillRect(0, 0, canvas.width, H / 2)
ctx.fillStyle = '#475569'
ctx.fillRect(0, H / 2, canvas.width, H / 2)
function loop() {
draw()
requestAnimationFrame(loop)
}
requestAnimationFrame(loop)
```H is a short name for the canvas height, used a lot in the drawing.H / 2.draw, write H and the ceiling and floor.draw() at the bottom with loop and requestAnimationFrame(loop).Skills: The game loop, Drawing on a canvas