Intermediate
Draw only when something changed
This page redraws 60 times a second even though nothing moves. Use a dirty flag so it draws once at the start and again only when you click the canvas.
A click (a pointerdown) must turn the box a quarter turn (π / 2 around y) and cause a new frame.
What Check tests
- The scene is drawn at least once
- While nothing changes, at most 3 frames are drawn in 400 ms
- A pointerdown draws a new frame
- The box turned a quarter turn
Stuck? One hint at a time
The solution unlocks after your first Check. Try first: that is where the learning happens.
Runs in your browser. Your code is saved here.
Your page
Press Run to see the page.
Console
Nothing logged yet.