Table of Contents

Day 5 - Friday

Activities/Announcements

Class Assignments

  1. Processing: Project - Pick a simulation that will teach me something. YOU MUST WORK WITH YOUR TEAM!!!
    1. Suggestions:
      1. Physics - Get objects to bounce and collide. Use gravity, if possible.
      2. Sieve of Eratosthenes - Show how this method works
      3. Cellular Automata - Show what Cellular Automata is
      4. Make a Game - To make a game, give it interactions and a winning condition (Ludus and Paida).
  2. Github - You can store your processing projects directly there and run them with Processing.js - Read: http://processingjs.org/articles/jsQuickStart.html (Similar to yesterday)
  3. FEEDBACK FORM: Please fill out feedback form…

Homework

Note: From now on ALL game reviews must address Ludus, Paida, and Narrative.

Feedback to class

Teams

color c = color(0);
float x = 0;
float y = 100;
float speed = 1;
 
void setup() {
  size(200,200);
}
 
void draw() {
  background(255);
  move();
  display();
}
 
void move() {
  x = x + speed;
  if (x > width) {
    x = 0;
  }
}
 
void display() {
  fill(c);
  rect(x,y,30,10);
}
 
// Example: Two Car objects
Car myCar1;
Car myCar2; // Two objects!
 
void setup() {
  size(200,200);
  // Parameters go inside the parentheses when the object is constructed.
  myCar1 = new Car(color(255,0,0),0,100,2); 
  myCar2 = new Car(color(0,0,255),0,10,1);
}
 
void draw() {
  background(255);
  myCar1.drive();
  myCar1.display();
  myCar2.drive();
  myCar2.display();
}
 
// Even though there are multiple objects, we still only need one class. 
// No matter how many cookies we make, only one cookie cutter is needed.
class Car { 
  color c;
  float xpos;
  float ypos;
  float xspeed;
 
  // The Constructor is defined with arguments.
  Car(color tempC, float tempXpos, float tempYpos, float tempXspeed) { 
    c = tempC;
    xpos = tempXpos;
    ypos = tempYpos;
    xspeed = tempXspeed;
  }
 
  void display() {
    stroke(0);
    fill(c);
    rectMode(CENTER);
    rect(xpos,ypos,20,10);
  }
 
  void drive() {
    xpos = xpos + xspeed;
    if (xpos > width) {
      xpos = 0;
    }
  }
}
int x, y;
void setup() 
{
  size (500,500);
}
 
void draw()
{
  ellipse(x,y,20,20); 
  if ((key == 'd') && (keyPressed))
  {
    x++;
  }
  else if (key == 's')
  {
    y++;
  }  
 
}