Intehttps://vimeo.com/194875413

 

Code: 

int startFrames = 6;
int pathFrames = 5;
int deathFrames = 6;
int forestFrames = 12;
int scapeFrames = 12;
int sleepFrames = 12;
int wakeFrames = 6;
int hillFrames = 8;
int chamFrames = 10;
int walkerFrames = 8;
int kingFrames = 10;
int evilFrames = 12;
int foreverFrames = 10;
int frame = 0;
long timer;
float framespeed = 215;
float theta;
PImage[] startscreen = new PImage[startFrames];
PFont title;
int screensizex, screensizey, stage;
PImage[] path = new PImage[pathFrames];
PImage[] die = new PImage[deathFrames];
PImage[] forest = new PImage[forestFrames];
PImage[] scape = new PImage[scapeFrames];
PImage[] sleep = new PImage[sleepFrames];
PImage[] wake = new PImage[wakeFrames];
PImage[] hill = new PImage[hillFrames];
PImage[] cham = new PImage[chamFrames];
PImage[] walker = new PImage[walkerFrames];
PImage[] king = new PImage[kingFrames];
PImage[] evil = new PImage[evilFrames];
PImage[] forever = new PImage[foreverFrames];
void setup() {
screensizex = round(width*0.90);
screensizey = round(height*0.90);
size(1220, 900);
stage = 1;
startscreen[0] = loadImage(“1.jpg”);
startscreen[1] = loadImage(“2.jpg”);
startscreen[2] = loadImage(“3.jpg”);
startscreen[3] = loadImage(“4.jpg”);
startscreen[4] = loadImage(“5.jpg”);
startscreen[5] = loadImage(“6.jpg”);
timer = millis();
imageMode(CENTER);
path[0] = loadImage(“path1.jpg”);
path[1] = loadImage(“path2.jpg”);
path[2] = loadImage(“path3.jpg”);
path[3] = loadImage(“path4.jpg”);
path[4] = loadImage(“path5.jpg”);
timer = millis();
imageMode(CENTER);
die[0] = loadImage(“death1.jpg”);
die[1] = loadImage(“death2.jpg”);
die[2] = loadImage(“death3.jpg”);
die[3] = loadImage(“death4.jpg”);
die[4] = loadImage(“death5.jpg”);
die[5] = loadImage(“death6.jpg”);
timer=millis();
imageMode(CENTER);

}
void draw() {
if (millis() – timer > framespeed) {
timer = millis();
frame ++;
}

if (stage==1) {
image(startscreen[frame], width/2, height/2);
if (frame == startFrames-1) {
frame = 0;
}
textAlign(CENTER);
text(“SLUMBER: DREAM VS NIGHTMARE”, 236, 443);
text(“Press ENTER”, 229, 466);
text(“D=PATH(1),S=PATH(2),A=PATH(3)”, 233, 554);
text(“REMEMBER THIS!!!!”, 235, 576);
fill(0);
}
if (stage==2) {
image(path[frame], width/2, height/2);
if (frame == pathFrames-1) {
frame = 0;
}
}
if (stage==3){
image(die[frame], width/2, height/2);
if (frame == deathFrames-1) {
frame = 0;
}
}
if (stage==4){
background(0);
frameRate(40);
stroke(-129);
float a = (mouseX / (float) width) * 90f;
theta = radians(a);
translate(width/2,height);
line(0,0,0,-157);
translate(0,-147);
branch(mouseX);
fill(255);
stroke(5);
textAlign(CENTER);
text(“ENTER YOUR DREAMS”, 500, 400 );
text(“INTO THE FOREST OF DREAMS”, 330, 400);

}

if (keyPressed == true ) {
stage = 2;
}

if (key == ‘d’) {
stage = 3;
}
if (key == ‘s’) {
stage = 4;
}
}

void branch(float h) {
h *= 0.66;
if (h > 2) {
pushMatrix();
rotate(theta);
line(0, 0, 0, -h);
translate(0, -h);
branch(h);
popMatrix();
pushMatrix();
rotate(-theta);
line(0, 0, 0, -h);
translate(0, -h);
branch(h);
popMatrix();
}
}

Advertisements
This entry was posted in Time-Based and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s