Advertisement
Guest User

scenes

a guest
Apr 7th, 2020
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.17 KB | None | 0 0
  1. PImage startscreen;
  2. PImage classroom;
  3. PImage darkclass;
  4.  
  5. PImage sammy1;
  6. PImage sammy2;
  7. PImage sammy3;
  8.  
  9. PImage luis1;
  10.  
  11. /********* VARIABLES *********/
  12.  
  13. // We control which screen is active by settings / updating
  14. // gameScreen variable. We display the correct screen according
  15. // to the value of this variable.
  16. //
  17. // 0: Initial Screen
  18. // 1: Game Screen
  19. // 2: Game-over Screen
  20.  
  21. int gameScreen = 0;
  22. int scene = 1;
  23. int messageCounter=0;
  24. boolean message1 = false;
  25.  
  26. /********* SETUP BLOCK *********/
  27.  
  28. void setup() {
  29. size(1280, 720);
  30. startscreen = loadImage("startscreen.png");
  31.  
  32. classroom = loadImage("class.png");
  33. darkclass = loadImage("darkclass.jpg");
  34.  
  35. sammy1 = loadImage("sammy1.png");
  36. sammy2 = loadImage("sammy2.png");
  37. sammy3 = loadImage("sammy3.png");
  38.  
  39. luis1 = loadImage("luis1.png");
  40. }
  41.  
  42.  
  43. /********* DRAW BLOCK *********/
  44.  
  45. void draw() {
  46. // Display the contents of the current screen
  47. if (gameScreen == 0) {
  48. initScreen();
  49. } else if (scene == 1) {
  50. Scene1();
  51. } else if (scene == 2) {
  52. Scene2();
  53. } else if (scene == 3) {
  54. Scene3();
  55. } else if (scene == 4) {
  56. Scene4();
  57. } else {
  58.  
  59. //the end!!!!
  60. background(0);
  61. textSize(159); //test dialogue for now. If you press the mouse there is dialogue
  62. fill(255);
  63. text("The END", 220, 390);
  64. }
  65. }
  66.  
  67.  
  68. /********* SCREEN CONTENTS *********/
  69.  
  70. void initScreen() {
  71. // codes of initial screen
  72. background(0);
  73. startscreen.resize(590, 500);
  74. image(startscreen, 360, 100);
  75. }
  76. void gameScreen() {
  77. // codes of game screen
  78. background(255);
  79. fill(255, 27, 170);
  80. circle(120, 200, 60);
  81. }
  82. void gameOverScreen() {
  83. // codes for game over screen
  84. }
  85.  
  86. /********* SCENE CONTENTS *********/
  87.  
  88. boolean isPointInRectangle(float px, float py,
  89. float rx, float ry,
  90. float rw, float rh) {
  91. if (px >= rx &&
  92. px <= rx + rw &&
  93. py >= ry &&
  94. py <= ry + rh) {
  95. return true;
  96. }
  97. return false;
  98. }
  99.  
  100. //=======//
  101.  
  102. void Scene1() {
  103. background(255, 200, 155);
  104. classroom.resize(1280, 720);
  105. image(classroom, 0, 0);
  106.  
  107. if (!message1) {
  108. }
  109.  
  110. //drawing the arrow only when the text is finished
  111. if (message1 == true) {
  112. fill(0);
  113. stroke(255);
  114. strokeWeight(4);
  115. triangle(1050, 600, 1050, 640, 1090, 620);
  116. }
  117. //end of the arrow
  118.  
  119. if (messageCounter==0) {
  120.  
  121. fill(0);
  122. String Aa = "This is test scene1";
  123. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  124. text(Aa, 185, 560, 920, 580);
  125. } else if (messageCounter==1) {
  126.  
  127. //IMAGE of the CHARACTER
  128. sammy1.resize(350, 300);
  129. image(sammy1, 760, 240);
  130.  
  131. //TEXT BOX OUTLINE
  132. noStroke();
  133. fill(255, 360);
  134. rect(145, 530, 1000, 150);
  135. //end of text bubble
  136.  
  137. //TEXT
  138. fill(0);
  139. String Ab = "I love luicalos sooooooo much he is the best thing ever!!!!!!!!!!!!!!!!!!";
  140. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  141. text(Ab, 185, 560, 920, 580);
  142.  
  143. //transparent box for the name
  144. fill(170, 220, 120, 140);
  145. rect(167, 479, 150, 60);
  146. fill(0);
  147. // the name of the character talking
  148. textSize(35);
  149. text("SAMMY", 180, 520);
  150. } else if (messageCounter==2) {
  151.  
  152. //IMAGE of the CHARACTER
  153. sammy1.resize(350, 300);
  154. image(sammy1, 760, 240);
  155.  
  156. //TEXT BOX OUTLINE
  157. noStroke();
  158. fill(255, 360);
  159. rect(145, 530, 1000, 150);
  160. //end of text bubble
  161.  
  162. fill(0);
  163. String Ac = "but why is he like this?";
  164. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  165. text(Ac, 185, 560, 920, 580);
  166.  
  167. //transparent box for the name
  168. fill(170, 220, 120, 140);
  169. rect(167, 479, 150, 60);
  170.  
  171. // the name of the character talking
  172. fill(0);
  173. textSize(35);
  174. text("SAMMY", 180, 520);
  175. } else if (messageCounter==3) {
  176. message1=true;
  177. }
  178.  
  179. //======extra text======//
  180.  
  181. if (!message1) {
  182. //outline
  183. fill(255);
  184. rect(980, 505, 149, 40);
  185. //text
  186. fill(0);
  187. textSize(15);
  188. text("Click on the screen", 985, 522);
  189. } else {
  190. //outline
  191. fill(255);
  192. rect(987, 565, 147, 27);
  193.  
  194. fill(0);
  195. textSize(15);
  196. text("Click on the Arrow", 992, 585);
  197. }
  198. //=====================//
  199. }
  200.  
  201. //=======//
  202.  
  203. void Scene2() {
  204. background(255, 150, 40);
  205. darkclass.resize(1280, 720);
  206. image(darkclass, 0, 0);
  207.  
  208. if (!message1) {
  209. ////TEXT BOX OUTLINE
  210. //noStroke();
  211. //fill(255, 360);
  212. //rect(145, 530, 1000, 150);
  213. ////end of text bubble
  214. }
  215.  
  216. //drawing the arrow only when the text is finished
  217. if (message1) {
  218. fill(0);
  219. stroke(255);
  220. strokeWeight(4);
  221. triangle(1050, 600, 1050, 640, 1090, 620);
  222. }
  223. //end of the arrow
  224.  
  225. if (messageCounter==0) {
  226.  
  227. //IMAGE of the CHARACTER
  228. sammy2.resize(350, 300);
  229. image(sammy2, 760, 240);
  230.  
  231. //TEXT BOX OUTLINE
  232. noStroke();
  233. fill(255, 360);
  234. rect(145, 530, 1000, 150);
  235. //end of text bubble
  236.  
  237. fill(0);
  238. String ba = "Hey. I need to talk to you";
  239. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  240. text(ba, 185, 560, 920, 580);
  241.  
  242.  
  243. //transparent box for the name
  244. fill(170, 220, 120, 140);
  245. rect(167, 479, 150, 60);
  246.  
  247. // the name of the character talking
  248. fill(0);
  249. textSize(35);
  250. text("SAMMY", 180, 520);
  251. } else if (messageCounter==1) {
  252. //IMAGE of the CHARACTER
  253. luis1.resize(350, 300);
  254. image(luis1, 760, 240);
  255.  
  256. //TEXT BOX OUTLINE
  257. noStroke();
  258. fill(255, 360);
  259. rect(145, 530, 1000, 150);
  260. //end of text bubble
  261.  
  262. fill(0, 100, 250);
  263. String bb = "what do you want?";
  264. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  265. text(bb, 185, 560, 920, 580);
  266.  
  267. //transparent box for the name
  268. fill(0, 100, 250, 140);
  269. rect(167, 479, 150, 60);
  270.  
  271. // the name of the character talking
  272. fill(0);
  273. textSize(35);
  274. text("LUIS", 180, 520);
  275. } else if (messageCounter==2) {
  276. //IMAGE of the CHARACTER
  277. sammy3.resize(350, 300);
  278. image(sammy3, 760, 240);
  279.  
  280. //TEXT BOX OUTLINE
  281. noStroke();
  282. fill(255, 360);
  283. rect(145, 530, 1000, 150);
  284. //end of text bubble
  285.  
  286. fill(0);
  287. String bc = "I need to tell you something.......I";
  288. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  289. text(bc, 185, 560, 920, 580);
  290.  
  291. //transparent box for the name
  292. fill(170, 220, 120, 140);
  293. rect(167, 479, 150, 60);
  294.  
  295. // the name of the character talking
  296. fill(0);
  297. textSize(35);
  298. text("SAMMY", 180, 520);
  299. } else if (messageCounter==3) {
  300. //IMAGE of the CHARACTER
  301. sammy3.resize(350, 300);
  302. image(sammy3, 760, 240);
  303.  
  304. //TEXT BOX OUTLINE
  305. noStroke();
  306. fill(255, 360);
  307. rect(145, 530, 1000, 150);
  308. //end of text bubble
  309.  
  310. fill(0);
  311. String bc = "I.......I LOVE YOU!!!";
  312. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  313. text(bc, 185, 560, 920, 580);
  314.  
  315. textSize(35);
  316.  
  317. //transparent box for the name
  318. fill(170, 220, 120, 140);
  319. rect(167, 479, 150, 60);
  320.  
  321. // the name of the character talking
  322. fill(0);
  323. text("SAMMY", 180, 520);
  324. } else if (messageCounter==4) {
  325. message1=true;
  326. }
  327.  
  328. //======extra text======//
  329. if (!message1) {
  330. //outline
  331. fill(255);
  332. rect(980, 505, 149, 40);
  333. //text
  334. fill(0);
  335. textSize(15);
  336. text("Click on the screen", 985, 522);
  337. } else {
  338. //outline
  339. fill(255);
  340. rect(987, 565, 147, 27);
  341.  
  342. fill(0);
  343. textSize(15);
  344. text("Click on the Arrow", 992, 585);
  345. }
  346. //=====================//
  347. }
  348.  
  349. //=======//
  350.  
  351. void Scene3() {
  352. background(105, 150, 40);
  353.  
  354. if (!message1) {
  355. }
  356.  
  357. //drawing the arrow only when the text is finished
  358. if (message1) {
  359. fill(0);
  360. stroke(255);
  361. strokeWeight(4);
  362. triangle(1050, 600, 1050, 640, 1090, 620);
  363. }
  364. //end of the arrow
  365.  
  366. if (messageCounter==0) {
  367. //IMAGE of the CHARACTER
  368.  
  369.  
  370. //TEXT BOX OUTLINE
  371. noStroke();
  372. fill(255, 360);
  373. rect(145, 530, 1000, 150);
  374. //end of text bubble
  375.  
  376. fill(0);
  377. String bc = "STOPPPPPPPPPPPPPPP!!!!!!!!!!!";
  378. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  379. text(bc, 185, 560, 920, 580);
  380.  
  381. //transparent box for the name
  382. fill(108, 220, 255, 140);
  383. rect(167, 479, 150, 60);
  384.  
  385. // the name of the character talking
  386. fill(0);
  387. textSize(35);
  388. text("Sharen", 180, 520);
  389.  
  390. } else if (messageCounter==1) {
  391. //
  392. message1=true;
  393. }
  394.  
  395. //======extra text======//
  396. if (!message1) {
  397. //outline
  398. fill(255);
  399. rect(980, 505, 149, 40);
  400. //text
  401. fill(0);
  402. textSize(15);
  403. text("Click on the screen", 985, 522);
  404. } else {
  405. //outline
  406. fill(255);
  407. rect(987, 565, 147, 27);
  408.  
  409. fill(0);
  410. textSize(15);
  411. text("Click on the Arrow", 992, 585);
  412. }
  413. //=====================//
  414. }
  415.  
  416. //=======//
  417.  
  418. void Scene4() {
  419. background(100, 250, 240);
  420.  
  421. if (!message1) {
  422. }
  423.  
  424. //drawing the arrow only when the text is finished
  425. if (message1) {
  426. fill(0);
  427. stroke(255);
  428. strokeWeight(4);
  429. triangle(1050, 600, 1050, 640, 1090, 620);
  430. }
  431. //end of the arrow
  432.  
  433. if (messageCounter==0) {
  434.  
  435. //IMAGE of the CHARACTER
  436.  
  437.  
  438. //TEXT BOX OUTLINE
  439. noStroke();
  440. fill(255, 360);
  441. rect(145, 530, 1000, 150);
  442. //end of text bubble
  443.  
  444. fill(0);
  445. String bc = "what are you doing???";
  446. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  447. text(bc, 185, 560, 920, 580);
  448.  
  449. //transparent box for the name
  450. fill(138, 120, 255, 140);
  451. rect(167, 479, 150, 60);
  452.  
  453. // the name of the character talking
  454. fill(0);
  455. textSize(35);
  456. text("ADAM", 180, 520);
  457.  
  458. } else if (messageCounter==1) {
  459. //IMAGE of the CHARACTER
  460.  
  461.  
  462. //TEXT BOX OUTLINE
  463. noStroke();
  464. fill(255, 360);
  465. rect(145, 530, 1000, 150);
  466. //end of text bubble
  467.  
  468. fill(0);
  469. String bc = "I thought....we were together";
  470. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  471. text(bc, 185, 560, 920, 580);
  472.  
  473. //transparent box for the name
  474. fill(138, 120, 255, 140);
  475. rect(167, 479, 150, 60);
  476.  
  477. // the name of the character talking
  478. fill(0);
  479. textSize(35);
  480. text("ADAM", 180, 520);
  481. } else if (messageCounter==2) {
  482. //IMAGE of the CHARACTER
  483.  
  484.  
  485. //TEXT BOX OUTLINE
  486. noStroke();
  487. fill(255, 360);
  488. rect(145, 530, 1000, 150);
  489. //end of text bubble
  490.  
  491. fill(0);
  492. String bc = "how could you....................HOW COULD YOU!!!!!!!!";
  493. textSize(22); //test dialogue for now. If you press the mouse there is dialogue
  494. text(bc, 185, 560, 920, 580);
  495.  
  496. //transparent box for the name
  497. fill(138, 120, 255, 140);
  498. rect(167, 479, 150, 60);
  499.  
  500. // the name of the character talking
  501. fill(0);
  502. textSize(35);
  503. text("ADAM", 180, 520);
  504. } else if (messageCounter==3) {
  505. //
  506. message1=true;
  507. }
  508.  
  509. //======extra text======//
  510. if (!message1) {
  511. //outline
  512. fill(255);
  513. rect(980, 505, 149, 40);
  514. //text
  515. fill(0);
  516. textSize(15);
  517. text("Click on the screen", 985, 522);
  518. } else {
  519. //outline
  520. fill(255);
  521. rect(987, 565, 147, 27);
  522.  
  523. fill(0);
  524. textSize(15);
  525. text("Click on the Arrow", 992, 585);
  526. }
  527. //=====================//
  528. }
  529.  
  530. /********* INPUTS *********/
  531.  
  532. public void mousePressed() {
  533. // if we are on the initial screen when clicked, start the game
  534. if (gameScreen==0) {
  535. startGame();
  536. }
  537. messageCounter++;
  538. if (message1 && mousePressed &
  539. isPointInRectangle(mouseX, mouseY, 1050, 600, 40, 40)) {
  540. scene = scene + 1; // if you click on the triangle on the screen you go to the next scene
  541. message1 = false; // reset
  542. messageCounter=0;
  543. } else {
  544. // message1 = true;
  545. }
  546. }
  547.  
  548.  
  549.  
  550. /********* OTHER FUNCTIONS *********/
  551.  
  552. // This method sets the necessary variables to start the game
  553. void startGame() {
  554. gameScreen=1;
  555. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement