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:
Twine - Interactive fiction and creating a story
Github - Managing code
Arduino - Electronics
Algorithms - Solving problems
Artificial Intelligence - Machines and humans
Processing - Programming language
Animations/Graphics - Motion and images
Game Design - What is a game?
Roles of Development - Types of jobs
Blogging with Jekyll - What is a blog and how to make one
Choose your own topic
Blog - Write a post to thank Chinara
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.
Blog - Blog the animations that you worked on today. Upload to Github.
-
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;
}
}
}