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);                                   
     }                                                                      

 

 

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:

  1. Alter it to use the setup() and draw() routines.
  2. Make it responsive to mouse movement and mouse presses. Be creative! Perhaps pressing the mouse button causes your figure to blink or open its mouth.

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:

  1. Add the ability to respond to key press commands.
  2. Include the use of at least 5 key strokes, including a mix of alphanumeric characters and the arrow keys.

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 (Links to an external site.)Links to an external site. for examples if needed.

 

Processing Loops

Modify your sketchbook from “Keyboard Input” as follows:

  1. Add a while loop that adds various repeated components to your figure.
  2. The loop should execute a minimum of 3 times.