User Tools

Site Tools


day7

Day 7

Teams

  1. Sana, Nurbal
  2. Madi, Aibat
  3. Azim, Bibinur
  4. Zarina, Ulpan
  5. Madina, Eldana
  6. Aisulu, Aruzhan
  7. Miras, Olzhas
  8. Anvar, Lyailya

Lesson

Assignment/Homework

  1. Blog - Pick 3 topics. Write a post about the most interesting topic to present on the last day. Why do you like it? Why would people find this interesting? Pick 3 from these:
    1. Twine - Interactive fiction and creating a story
    2. Github - Managing code
    3. Arduino - Electronics
    4. Algorithms - Solving problems
    5. Artificial Intelligence - Machines and humans
    6. Processing - Programming language
    7. Animations/Graphics - Motion and images
    8. Game Design - What is a game?
    9. Roles of Development - Types of jobs
    10. Blogging with Jekyll - What is a blog and how to make one
    11. Choose your own topic
  2. Blog - Write a post to thank Chinara
  3. Design Document - Pick something in the world or your community that can be improved. Use a one-page design document like we described in class. Create a serious game (What's a game?) like Train or that Dragon Cancer. What type of “train” are you driving? Make a 1-page design doc, like we did in class on paper. Bring in tomorrow.
  4. Blog - Blog the animations that you worked on today. Upload to Github.
  5. Feedback - Click Here - GIVE GOLD STARS PLEASE

Line Game

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;
    }
  }
}
Ball ball1;
Ball ball2;
Ball ball3;
Ball ball4;
 
void setup() {
  size(400,400);
  ball1 = new Ball(20,50, 2, -3);
  ball2 = new Ball(30,50, 3, 2);
  ball3 = new Ball(20,70, 1, -1);
  ball4 = new Ball(100,90, 1, 1);
}
 
void draw() {
  background(255);
  ball1.display();
  ball1.move();
  ball2.display();
  ball2.move();
  ball3.display();
  ball3.move();
  ball4.display();
  ball4.move();
}
 
class Ball {
  int x;
  int y;
  int xSpeed;
  int ySpeed;
 
  Ball(int tempX, int tempY, int xspeedtemp, int yspeedtemp) {
    x = tempX;
    y = tempY;
    xSpeed = xspeedtemp;
    ySpeed = yspeedtemp;
 
  }
 
  void display() {
    ellipse(x,y,20,20);
  }
 
  void move() {
    x = x + xSpeed;
    y = y + ySpeed;
 
    //if (x>400) {
    //  xSpeed = xSpeed * -1;
    //}
  }
}
Ball ball[] = new Ball[50];    //Array
 
void setup() {
  size(400,400);
 
  for(int i=0; i<ball.length; i++) {
    ball[i] = new Ball((int)random(0,400),(int)random(0,400),(int)random(-3,3),(int)random(-3,3));
  }
}
 
void draw() {
  background(255);
  for (int i=0; i<ball.length; i++){
    ball[i].move();
    ball[i].display();
  }
 
}
 
class Ball {
  int x;
  int y;
  int xSpeed;
  int ySpeed;
 
  Ball(int tempX, int tempY, int xspeedtemp, int yspeedtemp) {
    x = tempX;
    y = tempY;
    xSpeed = xspeedtemp;
    ySpeed = yspeedtemp;
 
  }
 
  void display() {
    ellipse(x,y,20,20);
  }
 
  void move() {
    x = x + xSpeed;
    y = y + ySpeed;
 
    if (x>400) {
      xSpeed = xSpeed * -1;
    }
  }
}
day7.txt · Last modified: 2016/06/28 01:55 by 188.0.136.18

Bitnami