Game & App Building

Mission 2: Make It Move

To animate something, you redraw it over and over, each time in a slightly different place — that's what requestAnimationFrame(draw) does, calling your draw function again on the next frame. clearRect wipes the stage first so you don't leave a trail of old squares behind.

Your turn

Open Coding Studio and make the square move in a different direction, or make it bounce back when it hits the edge.

Open Coding Studio
Ask JARVIS for a hint