Movement
Movement - Part 1: Introduction, Creating the file, Using setup()
and draw()
Movement - Part 2: Creating a Figure that Moves, Instructions for Activity
You will be creating a new blank sketchbook that will create and animate an ellipse on the screen. Please follow the steps provided:
void setup()
{
size(480, 240);
}
void draw()
{
if (mousePressed)
{
fill(0);
}
else
{
fill(255);
}
ellipse(mouseX, mouseY, 80, 80);
}
ellipse()
command reads ellipse(80, 80, mouseX, mousey)
. How does this change the program?background(200)
instruction at the beginning of the draw()
function block to have Processing redraw the background each time it refreshes the screen. Take notice as to how this effects the program.
Animating your Figure
Animate your Figure - Part 1: Introduction, Creating the file, Animating your Figure
Animate your Figure - Part 2: Finishing Animating your Figure, Instructions for Activity
Using your figure from the “Draw a Figure” activity, add the following functionality:
setup()
and draw()
routines.You may use the strategies outline in the Movement exercise.
Keyboard Input
Keyboard Input - Part 1: Introduction, Creating the file, Adding our First Keypress
Keyboard Input - Part 2: Adding the Final Keyboard Interaction, Instructions for Activity
Modify your sketchbook from “Animate Your Figure” as follows:
Much like the mouse button press, each of these key presses should alter the appearance or behavior of the figure in some unique way. Remember to reference the Processing Documentation for examples if needed.
Processing Loops
Modify your sketchbook from “Keyboard Input” as follows: