213
edits
Line 301: | Line 301: | ||
</source> | </source> | ||
<br /><br /> | <br /><br /> | ||
=== Exercise: Bouncing Line === | === Exercise I: Bouncing Line === | ||
This is one possible solution to achieve that the | This is one possible solution to achieve that the | ||
line from the example above changes it direction | line from the example above changes it direction | ||
Line 351: | Line 351: | ||
</source> | </source> | ||
<br /><br /> | <br /><br /> | ||
=== Exercise II: A frightened rectangle === | |||
Write a sketch that contains one rectangle with a size of 20x20px. | |||
As soon as the mouse pointer is over the rectangle, the rectangle | |||
starts to shiver. | |||
Some useful hints: | |||
* [http://processing.org/reference/mouseX.html mouseX] | |||
* [http://processing.org/reference/mouseY.html mouseY] | |||
* [http://processing.org/reference/random_.html random()] | |||
[[Category:WS11]] | [[Category:WS11]] |
edits