PImage img0;
PImage img1;
PImage img2;
PImage img3;
PImage img4;
PImage img5;
PImage img6;
PImage img7;
PImage imgend1;
PImage imgend2;
//PImage imgend3;
//PImage imgt4;
PFont font;
int frame = 1;
void setup(){
size(600, 400);
noStroke();
noCursor();
smooth();
font = loadFont("ArialNarrow-Bold-48.vlw");
textFont(font);
frameRate(56);
//background(0);
img0 =loadImage("cursor.jpg");
img1 =loadImage("intro.jpg");
img2= loadImage("screen2.jpg");
img3 =loadImage("screen3.jpg");
img4 =loadImage("screen4.jpg");
img5 =loadImage("screen5.jpg");
img6 =loadImage("screen6.jpg");
img7 =loadImage("screen7.jpg");
imgend1 =loadImage("end1.jpg");
imgend2 =loadImage("end2.jpg");
//imgend3 =loadImage("end3.jpg");
//imgt4 =loadImage("end4.jpg");
}
void draw(){
//background(200); //2nd screen
image(img0, mouseX, mouseY);
if (frame == 1) {
image(img1, 0, 0);
text("WELCOME: Click the mouse",10,50);
text("to find your turtle and begin!!", 0, 100);
}
else if (frame ==2) {
image(img2, 0, 0);
}
else if (frame ==3) {
background(0);
textAlign(CENTER);
textSize(32);
text("come on now, dont take your", 300, 100);
text("turtle to the doldrums, SPICE IT UP!", 300, 200);
textSize(18);
//fill(50);
text("'enter' to continue", 300, 270);
}
else if (frame ==4) {
image(img4, 0, 0, width, height);
}
else if (frame ==5) {
background(0);
textAlign(CENTER);
textSize(32);
text("NO NO NO", 300, 100);
text("pay closer attention next time", 300, 200);
textSize(18);
text("'enter' to continue", 300, 270);
}
else if (frame ==6) {
image(img6, 0, 0);
}
else if (frame ==7) {
image(img7, 0, 0);
}
else if (frame ==8) {
image(imgend1, 0, 0,width, height);
}
else if (frame ==9) {
image(imgend2, 0, 0, width, height);
}
}
void mousePressed() {
//image(img0, mouseX, mouseY);
if (frame == 1) {
frame ++;
}
else if (frame == 2) {
if (mouseX > 250) {
frame = 3;
}
else {
frame = 4;
}
}
else if (frame == 3) {
if ((keyPressed == true) && ((key == ENTER)||(key==RETURN))) {
frame = 2;
}
}
else if (frame == 4) {
if (mouseY < 100) {
frame = 8;
}
else if ((mouseY >100) && (mouseY <200)){
frame = 5;
}
else {
frame = 9;
}
}
else if (frame == 5) {
if ((keyPressed == true) && ((key == ENTER)||(key==RETURN))) {
frame = 4;
}
}
}
Alex - Project 1
on Monday, Nov 3, 2008 – 9:34 am