Assignments | Course Home | Documentation | Lab Hours/Tutoring | Schedule | Submit

Saint Louis University

Computer Science 144
Introduction to Computer Science: Multimedia

Michael Goldwasser

Spring 2015

Dept. of Math & Computer Science

Hands-on Activity: Control Strutcures

If you'd like to work locally, you may choose to download a single zipfile with the entire collection, and place it within your Processing sketchbook.

Sketch My Code
Instructions
recolor_circle.pde

Click on the circle to recolor it
recolor_rectangle.pde

Click on the rectangle to recolor it
sunriseSunset.pde

Click anywhere to toggle between day and night.

(Extra challenge: find a way to animate the transitions more gradually)
growing_smiley.pde

A variant on the "growing circle" from last class. This time we draw a smiley face with a user-defined function.

Click and hold to draw a new face.
bouncing_circle.pde

Use of conditional statements and switch statement to animate a ball moving on the screen and bouncing on the edges of the canvas.

The velocity of the ball can be changed dynamically by using the arrow keys.

(Note: there is a subtle flaw in the logic; can you get the ball to protrude into a wall? Can you decide how to fix the flaw?)
recolor_bouncing_circle.pde

Same as previous, but with added feature that clicking on the ball changes its color.

Michael Goldwasser
CSCI 144, Spring 2015
Last modified: Wednesday, 28 January 2015
Assignments | Course Home | Documentation | Lab Hours/Tutoring | Schedule | Submit