This course will become read-only in the near future. Tell us at community.p2pu.org if that is a problem.

Exercises for Week 3 - Animation and Scrolling


3.1 - Scrolling in Two Dimensions

The scrolling code in Example 3.2 only scrolls left and right.  Modify the scrolling code so that it can scroll in all four dimensions - up, down, left, and right - in response to the player's movement.

You can either integrate a scrolling feature into one of your exercises from week 2, or you can take the code from Example 3.2 and add vertical movement to it.

3.2 - Animating

Take one of your existing projects (could even be 3.1) and jazz it up a little bit by adding either a multi-frame sprite animation (like the one in Example 3.3) or a canvas transformation (like the ones in Example 2.7).

For example, if you're already animating a ghost... give it a couple of frames of bobbing animation as it floats along.  And if you're drawing playing cards to a surface... use Canvas rotation transforms to display the cards at different angles.

Task Discussion