Workshop › Lunar Lander › Step 6 of 31
The lander will tilt. Instead of computing every tilted corner, we move and turn the drawing itself to the lander, then draw a simple upright triangle around (0, 0).
```js
function drawLander() {
ctx.save()
ctx.translate(lander.x, lander.y)
ctx.rotate(lander.angle)
ctx.fillStyle = '#e2e8f0'
ctx.beginPath()
ctx.moveTo(0, -12)
ctx.lineTo(9, 8)
ctx.lineTo(-9, 8)
ctx.fill()
ctx.restore()
}
drawLander()
```save remembers the normal drawing position; restore goes back to it, so later drawings are not moved or turned.translate makes (0, 0) the lander's middle; rotate turns "up" into the lander's up.drawLander() is called after the ground, so the lander is drawn on top.drawLander just above function draw() {, with an empty line between.draw, under the pad's fillRect line, leave an empty line and write drawLander().Skills: Drawing on a canvas