Motion Paths — exercises and bug fixes
5 hands-on exercises and 5 find-the-bug challenges for the Motion Paths lesson. Every one is checked automatically in the browser — write the code, run it, and the tests tell you what still fails.
Exercises(5)
- 1
Define a motion path
easy10 minMove #box along a diagonal path from 0,0 to 100,100.
- 2
Place along the path
easy10 minPut #box halfway along its path.
- 3
Keep the element upright
easy10 minStop #box turning as it travels, by locking its rotation to 0 degrees.
- 4
Set the anchor point
easy10 minAnchor #box by its centre.
- 5
Animate along the path
medium10 minAttach a path, start at 25%, and follow the tangent.
Find the bug(5)
- 1
Fix the unquoted path
easy8 minThe path data must be a quoted string.
- 2
Fix the distance with no unit
easy8 minoffset-distance needs a length or percentage.
- 3
Fix the fixed rotation
easy8 minThis element should follow the path direction, not hold a 90 degree angle.
- 4
Fix the misspelled property
easy8 minThe property is offset-anchor.
- 5
Fix the path on the wrong element
easy8 minThe moving box needs the path, not the wrapper.
Ready to write the code?
The editor, the automatic checks and the worked solutions open up with an account.
Open the workspace