User Tools

Site Tools


cs276:e16:hw3
  • Read: Typography 1, p. 111, pp. 223-234; Typography 2 starting p. 327, and Typography 3 starting p. 333.
  • Try Sketch 36-02, p. 238. Now modify the sketch to display more than two words; choose the words displayed randomly from an array of words loading using loadString. Experiment with different placements of text, and different fill colors. You'll want to make the drawing window larger.
  • Similarly, try Sketch 36-07 and modify it to use Perlin noise to add a tinge of unpredicability to the letter's movements.
  • Consider the following program, from Daniel Shiffman's book Learning Processing.
// Learning Processing
// Daniel Shiffman
// http://www.learningprocessing.com
 
// Example 5-6: Bouncing Ball
int x = 0;
int speed = 1;
 
void setup() {
  size(200,200);
  smooth();
}
 
void draw() {
  background(255);
 
  // Add the current speed to the x location.
  x = x + speed;
 
  if ((x > width) || (x < 0)) {
    // If the object reaches either edge, multiply speed by -1 to turn it around.
    speed = speed * -1;
  }
 
  // Display circle at x location
  stroke(0);
  fill(175);
  ellipse(x,100,32,32);
}

Change this program so that when the user types the Up Arrow key, the ball speeds up, but when the Down Arrow is pressed it slows back down.

Even more interesting, use a PFont object to display the coordinates of the ball as it moves. The coordinates will keep pace with the ball as it moves, updating continuously (8 points).

cs276/e16/hw3.txt · Last modified: 2016/02/29 18:05 by scarl