Difference between revisions of "Animation"
(→Lots of squares - lots of colours)
|Line 1:||Line 1:|
|Line 148:||Line 148:|
Revision as of 19:15, 6 December 2015
You can click on "Show" to see the full program.
The method drawFrame is called 20 times; frame is a different value each time, the graphics object is new each time. Draws a yellow rectangle at coordinates (50,8*frame-20) which is (50,-20), (50,-12), (50,-2), (50,6) ... (50,172) So the yellow box appears at the top of the image and moves down a little with each frame.
In this example both the x and the y coordinates change at each frame and so the star moves diagonally.
Lots of squares - one is a different colour
We draw 20 squares.
Each of them is yellow - except one.
Lots of squares - lots of colours
Less is not more. More is more.