Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PImage startscreen;
- PImage classroom;
- PImage darkclass;
- PImage sammy1;
- PImage sammy2;
- PImage sammy3;
- PImage luis1;
- /********* VARIABLES *********/
- // We control which screen is active by settings / updating
- // gameScreen variable. We display the correct screen according
- // to the value of this variable.
- //
- // 0: Initial Screen
- // 1: Game Screen
- // 2: Game-over Screen
- int gameScreen = 0;
- int scene = 1;
- int messageCounter=0;
- boolean message1 = false;
- /********* SETUP BLOCK *********/
- void setup() {
- size(1280, 720);
- startscreen = loadImage("startscreen.png");
- classroom = loadImage("class.png");
- darkclass = loadImage("darkclass.jpg");
- sammy1 = loadImage("sammy1.png");
- sammy2 = loadImage("sammy2.png");
- sammy3 = loadImage("sammy3.png");
- luis1 = loadImage("luis1.png");
- }
- /********* DRAW BLOCK *********/
- void draw() {
- // Display the contents of the current screen
- if (gameScreen == 0) {
- initScreen();
- } else if (scene == 1) {
- Scene1();
- } else if (scene == 2) {
- Scene2();
- } else if (scene == 3) {
- Scene3();
- } else if (scene == 4) {
- Scene4();
- } else {
- //the end!!!!
- background(0);
- textSize(159); //test dialogue for now. If you press the mouse there is dialogue
- fill(255);
- text("The END", 220, 390);
- }
- }
- /********* SCREEN CONTENTS *********/
- void initScreen() {
- // codes of initial screen
- background(0);
- startscreen.resize(590, 500);
- image(startscreen, 360, 100);
- }
- void gameScreen() {
- // codes of game screen
- background(255);
- fill(255, 27, 170);
- circle(120, 200, 60);
- }
- void gameOverScreen() {
- // codes for game over screen
- }
- /********* SCENE CONTENTS *********/
- boolean isPointInRectangle(float px, float py,
- float rx, float ry,
- float rw, float rh) {
- if (px >= rx &&
- px <= rx + rw &&
- py >= ry &&
- py <= ry + rh) {
- return true;
- }
- return false;
- }
- //=======//
- void Scene1() {
- background(255, 200, 155);
- classroom.resize(1280, 720);
- image(classroom, 0, 0);
- if (!message1) {
- }
- //drawing the arrow only when the text is finished
- if (message1 == true) {
- fill(0);
- stroke(255);
- strokeWeight(4);
- triangle(1050, 600, 1050, 640, 1090, 620);
- }
- //end of the arrow
- if (messageCounter==0) {
- fill(0);
- String Aa = "This is test scene1";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(Aa, 185, 560, 920, 580);
- } else if (messageCounter==1) {
- //IMAGE of the CHARACTER
- sammy1.resize(350, 300);
- image(sammy1, 760, 240);
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- //TEXT
- fill(0);
- String Ab = "I love luicalos sooooooo much he is the best thing ever!!!!!!!!!!!!!!!!!!";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(Ab, 185, 560, 920, 580);
- //transparent box for the name
- fill(170, 220, 120, 140);
- rect(167, 479, 150, 60);
- fill(0);
- // the name of the character talking
- textSize(35);
- text("SAMMY", 180, 520);
- } else if (messageCounter==2) {
- //IMAGE of the CHARACTER
- sammy1.resize(350, 300);
- image(sammy1, 760, 240);
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String Ac = "but why is he like this?";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(Ac, 185, 560, 920, 580);
- //transparent box for the name
- fill(170, 220, 120, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("SAMMY", 180, 520);
- } else if (messageCounter==3) {
- message1=true;
- }
- //======extra text======//
- if (!message1) {
- //outline
- fill(255);
- rect(980, 505, 149, 40);
- //text
- fill(0);
- textSize(15);
- text("Click on the screen", 985, 522);
- } else {
- //outline
- fill(255);
- rect(987, 565, 147, 27);
- fill(0);
- textSize(15);
- text("Click on the Arrow", 992, 585);
- }
- //=====================//
- }
- //=======//
- void Scene2() {
- background(255, 150, 40);
- darkclass.resize(1280, 720);
- image(darkclass, 0, 0);
- if (!message1) {
- ////TEXT BOX OUTLINE
- //noStroke();
- //fill(255, 360);
- //rect(145, 530, 1000, 150);
- ////end of text bubble
- }
- //drawing the arrow only when the text is finished
- if (message1) {
- fill(0);
- stroke(255);
- strokeWeight(4);
- triangle(1050, 600, 1050, 640, 1090, 620);
- }
- //end of the arrow
- if (messageCounter==0) {
- //IMAGE of the CHARACTER
- sammy2.resize(350, 300);
- image(sammy2, 760, 240);
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String ba = "Hey. I need to talk to you";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(ba, 185, 560, 920, 580);
- //transparent box for the name
- fill(170, 220, 120, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("SAMMY", 180, 520);
- } else if (messageCounter==1) {
- //IMAGE of the CHARACTER
- luis1.resize(350, 300);
- image(luis1, 760, 240);
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0, 100, 250);
- String bb = "what do you want?";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(bb, 185, 560, 920, 580);
- //transparent box for the name
- fill(0, 100, 250, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("LUIS", 180, 520);
- } else if (messageCounter==2) {
- //IMAGE of the CHARACTER
- sammy3.resize(350, 300);
- image(sammy3, 760, 240);
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String bc = "I need to tell you something.......I";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(bc, 185, 560, 920, 580);
- //transparent box for the name
- fill(170, 220, 120, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("SAMMY", 180, 520);
- } else if (messageCounter==3) {
- //IMAGE of the CHARACTER
- sammy3.resize(350, 300);
- image(sammy3, 760, 240);
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String bc = "I.......I LOVE YOU!!!";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(bc, 185, 560, 920, 580);
- textSize(35);
- //transparent box for the name
- fill(170, 220, 120, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- text("SAMMY", 180, 520);
- } else if (messageCounter==4) {
- message1=true;
- }
- //======extra text======//
- if (!message1) {
- //outline
- fill(255);
- rect(980, 505, 149, 40);
- //text
- fill(0);
- textSize(15);
- text("Click on the screen", 985, 522);
- } else {
- //outline
- fill(255);
- rect(987, 565, 147, 27);
- fill(0);
- textSize(15);
- text("Click on the Arrow", 992, 585);
- }
- //=====================//
- }
- //=======//
- void Scene3() {
- background(105, 150, 40);
- if (!message1) {
- }
- //drawing the arrow only when the text is finished
- if (message1) {
- fill(0);
- stroke(255);
- strokeWeight(4);
- triangle(1050, 600, 1050, 640, 1090, 620);
- }
- //end of the arrow
- if (messageCounter==0) {
- //IMAGE of the CHARACTER
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String bc = "STOPPPPPPPPPPPPPPP!!!!!!!!!!!";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(bc, 185, 560, 920, 580);
- //transparent box for the name
- fill(108, 220, 255, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("Sharen", 180, 520);
- } else if (messageCounter==1) {
- //
- message1=true;
- }
- //======extra text======//
- if (!message1) {
- //outline
- fill(255);
- rect(980, 505, 149, 40);
- //text
- fill(0);
- textSize(15);
- text("Click on the screen", 985, 522);
- } else {
- //outline
- fill(255);
- rect(987, 565, 147, 27);
- fill(0);
- textSize(15);
- text("Click on the Arrow", 992, 585);
- }
- //=====================//
- }
- //=======//
- void Scene4() {
- background(100, 250, 240);
- if (!message1) {
- }
- //drawing the arrow only when the text is finished
- if (message1) {
- fill(0);
- stroke(255);
- strokeWeight(4);
- triangle(1050, 600, 1050, 640, 1090, 620);
- }
- //end of the arrow
- if (messageCounter==0) {
- //IMAGE of the CHARACTER
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String bc = "what are you doing???";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(bc, 185, 560, 920, 580);
- //transparent box for the name
- fill(138, 120, 255, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("ADAM", 180, 520);
- } else if (messageCounter==1) {
- //IMAGE of the CHARACTER
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String bc = "I thought....we were together";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(bc, 185, 560, 920, 580);
- //transparent box for the name
- fill(138, 120, 255, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("ADAM", 180, 520);
- } else if (messageCounter==2) {
- //IMAGE of the CHARACTER
- //TEXT BOX OUTLINE
- noStroke();
- fill(255, 360);
- rect(145, 530, 1000, 150);
- //end of text bubble
- fill(0);
- String bc = "how could you....................HOW COULD YOU!!!!!!!!";
- textSize(22); //test dialogue for now. If you press the mouse there is dialogue
- text(bc, 185, 560, 920, 580);
- //transparent box for the name
- fill(138, 120, 255, 140);
- rect(167, 479, 150, 60);
- // the name of the character talking
- fill(0);
- textSize(35);
- text("ADAM", 180, 520);
- } else if (messageCounter==3) {
- //
- message1=true;
- }
- //======extra text======//
- if (!message1) {
- //outline
- fill(255);
- rect(980, 505, 149, 40);
- //text
- fill(0);
- textSize(15);
- text("Click on the screen", 985, 522);
- } else {
- //outline
- fill(255);
- rect(987, 565, 147, 27);
- fill(0);
- textSize(15);
- text("Click on the Arrow", 992, 585);
- }
- //=====================//
- }
- /********* INPUTS *********/
- public void mousePressed() {
- // if we are on the initial screen when clicked, start the game
- if (gameScreen==0) {
- startGame();
- }
- messageCounter++;
- if (message1 && mousePressed &
- isPointInRectangle(mouseX, mouseY, 1050, 600, 40, 40)) {
- scene = scene + 1; // if you click on the triangle on the screen you go to the next scene
- message1 = false; // reset
- messageCounter=0;
- } else {
- // message1 = true;
- }
- }
- /********* OTHER FUNCTIONS *********/
- // This method sets the necessary variables to start the game
- void startGame() {
- gameScreen=1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement