Resources
- //INIT: Using objects
- //PROCESS: String addition
- //PROCESS: Timeout and intervals
- //PROCESS: Functions: Definition, trigger, or reference?
- //OUTPUT: Animating other CSS properties
Saving your work
Use Save as...
to save the empty template as
"
3.05H-TheSkyAtNight-LastName.html
"
in your Computer Programming 12 directory.
The assignment
Use functions to animate objects around the screen.
Like the opening credits of my favourite astronomy show,
The sky at night
.
For example
The sky at night
Evaluation
-
___/10 INIT: including
- create an empty object
- use the value of an object's property to create different animation behaviours
- pass an object to a function as a parameter/argument
- use an object with multiple properties inside an animation
-
___/10 PROCESS: including
- create a function that accepts an object as an argument/parameter
-
set a delay using
setTimeout()
orsetInterval
-
use an anonymous function inside
setTimeout()
orsetInterval
- use string addition
- processes all eight planets
-
___/10 OUTPUT: including ANY FIVE of
- change the src of an element
- display information using .innerHTML
- animate using a custom duration
-
position an object using
%
instead ofpx
- animate a change in the width of an element
- animate a fade in or fade out of an element
-
___/10 STYLE: including
- honour all previous //STYLE sections
- use descriptive variable names
- break up functions into separate ones for input, processing, and output
-
uses descriptive comments to identify
and describe each function,
for example://PROCESS: this function accepts distanceUp and animates the image up that number of pixels
-
add spaces between mathematical operators,
for example:var exampleVar = 3 + 4
, notvar exampleVar=3+4
.