Command Palette

Search for a command to run...

Hectal
Phase 9: Springs and Physics
Web Animation · Exercise 2 of 4 PreviousNext
Intermediate

Turn round without stopping

Go sends the ball right, Back sends it left. Pressing Back mid-flight makes a new spring that starts from rest.

Change goTo so a second press keeps the ball's speed: one frame after Back, the ball must still be moving forward.

What Check tests

  1. One frame after the turn-round click the ball still moves forward
  2. Then it turns round and heads back
  3. It ends at 0

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.
00:00.000
animations
0.00s0.10s0.20s0.30s0.40s0.50s0.60s0.70s0.80s0.90s

Nothing is moving yet. Hover, click or scroll the page: every animation it starts shows up here as a track.

frames

Console

Nothing logged yet.