From 461562c319bda34bd0e009e9af19401345538328 Mon Sep 17 00:00:00 2001 From: TechnicJelle <22576047+TechnicJelle@users.noreply.github.com> Date: Thu, 2 Dec 2021 14:23:17 +0100 Subject: [PATCH 1/2] removed intro, export works now --- .gitignore | 1 + CMGT_PointAndClick.pde | 6 +++--- data/highscores.csv | 2 ++ menus.pde | 41 +++++++++++++++++++++-------------------- 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/.gitignore b/.gitignore index 77c8cc2..8a6718d 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ application.macosx *.blend1 *.png~ *.kra~ +Afterparty_win64(no-intro).zip diff --git a/CMGT_PointAndClick.pde b/CMGT_PointAndClick.pde index feef64d..dcb5883 100644 --- a/CMGT_PointAndClick.pde +++ b/CMGT_PointAndClick.pde @@ -1,6 +1,6 @@ import processing.sound.*; -import processing.video.*; +//import processing.video.*; import java.util.Date; import java.text.SimpleDateFormat; @@ -30,7 +30,7 @@ int cursorInt; int score; int scoreMax; -Movie introVideo; +//Movie introVideo; boolean mediaLoaded; int millisAtGameStart; @@ -72,7 +72,7 @@ void settings() { } void loadMedia() { - introVideo = new Movie(this, "menus/main/introVideo.mp4"); + //introVideo = new Movie(this, "menus/main/introVideo.mp4"); sndTheme1 = new SoundFile(this, "sound/music/theme1.wav"); sndTheme3 = new SoundFile(this, "sound/music/theme3.wav"); diff --git a/data/highscores.csv b/data/highscores.csv index 3badc44..25b56f7 100644 --- a/data/highscores.csv +++ b/data/highscores.csv @@ -1,2 +1,4 @@ score,name,time +1375808,TechnicJelle,2021/12/02 14:21 1370498,TechnicJelle,2021/11/25 14:25 +1343170,Jelle,2021/12/02 14:04 diff --git a/menus.pde b/menus.pde index 259e3da..48c7d22 100644 --- a/menus.pde +++ b/menus.pde @@ -106,29 +106,30 @@ class IntroVideoScene extends Scene { void draw() { if (firstTime) { - introVideo.play(); + //introVideo.play(); firstTime = false; sndTheme2.stop(); + end(); } - if (introVideo.available()) - introVideo.read(); + //if (introVideo.available()) + // introVideo.read(); - canvas.image(introVideo, 0, 0); + //canvas.image(introVideo, 0, 0); - if (introVideo.time() < 2) - canvas.text("Press space to skip", 50, 50); + //if (introVideo.time() < 2) + // canvas.text("Press space to skip", 50, 50); - if (introVideo.duration() - introVideo.time() < 0.2) { - String s = "Objective: Clean up the house before your parents get home!\n\nPress space to start the game!"; - canvas.fill(0); - canvas.text(s, 52, 53); - canvas.fill(255); - canvas.text(s, 50, 50); - } + //if (introVideo.duration() - introVideo.time() < 0.2) { + // String s = "Objective: Clean up the house before your parents get home!\n\nPress space to start the game!"; + // canvas.fill(0); + // canvas.text(s, 52, 53); + // canvas.fill(255); + // canvas.text(s, 50, 50); + //} - if (debugMode) - println(introVideo.duration() + " - " + introVideo.time() + " = " + (introVideo.duration() - introVideo.time()), frameRate); + //if (debugMode) + // println(introVideo.duration() + " - " + introVideo.time() + " = " + (introVideo.duration() - introVideo.time()), frameRate); //if (introVideo.time() >= introVideo.duration() - 0.01) { // end(); @@ -140,8 +141,8 @@ class IntroVideoScene extends Scene { private void end() { try { sceneManager.goToScene("bk1beds"); - introVideo.stop(); - introVideo = null; //allow the gc to clear the video from memory + //introVideo.stop(); + //introVideo = null; //allow the gc to clear the video from memory sndTheme1.play(); if (debugMode) println("sndTheme1 dur: " + sndTheme1.duration()); } @@ -155,9 +156,9 @@ class IntroVideoScene extends Scene { } } -void movieEvent(Movie m) { - m.read(); -} +//void movieEvent(Movie m) { +// m.read(); +//} class EndScreen extends Scene { From 3312ad3d6100568a5dde3fdcc4e89e9955fbbc03 Mon Sep 17 00:00:00 2001 From: TechnicJelle <22576047+TechnicJelle@users.noreply.github.com> Date: Thu, 2 Dec 2021 15:36:03 +0100 Subject: [PATCH 2/2] Fix intro (Processing4b2, video-2.0-beta3) --- .gitignore | 1 + CMGT_PointAndClick.pde | 72 ++++++++++++++++++++++++++++++------------ data/highscores.csv | 2 -- menus.pde | 41 ++++++++++++------------ 4 files changed, 73 insertions(+), 43 deletions(-) diff --git a/.gitignore b/.gitignore index 8a6718d..7bd0f28 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ application.macosx *.png~ *.kra~ Afterparty_win64(no-intro).zip +Afterparty_win64.zip diff --git a/CMGT_PointAndClick.pde b/CMGT_PointAndClick.pde index dcb5883..c4dd294 100644 --- a/CMGT_PointAndClick.pde +++ b/CMGT_PointAndClick.pde @@ -1,6 +1,6 @@ import processing.sound.*; -//import processing.video.*; +import processing.video.*; import java.util.Date; import java.text.SimpleDateFormat; @@ -30,7 +30,7 @@ int cursorInt; int score; int scoreMax; -//Movie introVideo; +Movie introVideo; boolean mediaLoaded; int millisAtGameStart; @@ -72,7 +72,7 @@ void settings() { } void loadMedia() { - //introVideo = new Movie(this, "menus/main/introVideo.mp4"); + introVideo = new Movie(this, "menus/main/introVideo.mp4"); sndTheme1 = new SoundFile(this, "sound/music/theme1.wav"); sndTheme3 = new SoundFile(this, "sound/music/theme3.wav"); @@ -422,11 +422,11 @@ void setup() { //dishes task Collectable[] dishesCollectables = new Collectable[] { plate1, plate2, plate3, plate4, plate5 }; String[] dishesPileStates = new String[] { - "piles/dishes/state0empty.png", - "piles/dishes/state1.png", - "piles/dishes/state2.png", - "piles/dishes/state3.png", - "piles/dishes/state4.png", + "piles/dishes/state0empty.png", + "piles/dishes/state1.png", + "piles/dishes/state2.png", + "piles/dishes/state3.png", + "piles/dishes/state4.png", "piles/dishes/state5.png"}; MoveToSceneObject startDishArrow = new MoveToSceneObject("startDishArrow", 508, 549, "rooms/livingRoom/counterDirtyStart.png", "taskDish"); RequireObject requireSponge = new RequireObject("requireSponge", 508, 549, "rooms/livingRoom/counterDirty.png", "Wash the dishes with a sponge!", sponge, (GameObject)startDishArrow); @@ -509,10 +509,10 @@ void setup() { //folding task Collectable[] foldingCollectables = new Collectable[] { clothes1, clothes2, clothes3, clothes4 }; String[] foldingPileStates = new String[] { - "piles/clothes/state0empty.png", - "piles/clothes/state1.png", - "piles/clothes/state2.png", - "piles/clothes/state3.png", + "piles/clothes/state0empty.png", + "piles/clothes/state1.png", + "piles/clothes/state2.png", + "piles/clothes/state3.png", "piles/clothes/state4.png"}; MoveToSceneObject foldingTask = new MoveToSceneObject("goToFoldingTask", 777.6, 511.2, "piles/clothes/state4start.png", "TaskFolding"); RequireObject startFolding = new RequireObject("startFolding", 777.6, 511.2, foldingPileStates, "Bring all clothes here", foldingCollectables, (GameObject)foldingTask); @@ -559,7 +559,7 @@ void setup() { //try { // sceneManager.goToScene("taskDish"); - //} + //} //catch(Exception e) { // println(e); //} @@ -627,12 +627,12 @@ void draw() { image(canvas, 0, 0, width, height); } - if (debugMode) { + if (debugMode) { text(frameRate, 10, 10); text(score + "/" + scoreMax, 10, 40); text(millisLeft, 10, 70); - text(sndTheme1.isPlaying() ? "1playing" : "1not", 10, 100); - text(sndTheme2.isPlaying() ? "2playing" : "2not", 10, 130); + text(sndTheme1.isPlaying() ? "1playing" : "1not", 10, 100); + text(sndTheme2.isPlaying() ? "2playing" : "2not", 10, 130); text(sndTheme3.isPlaying() ? "3playing" : "3not", 10, 160); } @@ -642,7 +642,7 @@ void draw() { void endGame() { try { sceneManager.goToScene("endscreen"); - } + } catch (Exception e) { println(e); } @@ -662,7 +662,39 @@ void exit() { String strDate = sdfDate.format(now); saveTable(analyticsTable, "analytics/" + strDate + ".csv"); } + surface.setVisible(false); + try { + introVideo.stop(); + sndTheme1.stop(); + sndTheme2.stop(); + sndTheme3.stop(); + + sfxBroom1.stop(); + sfxBroom2.stop(); + sfxClosingCloset.stop(); + sfxDoorOpen1.stop(); + sfxDoorOpen2.stop(); + sfxPing.stop(); + sfxFolding1.stop(); + sfxFolding2.stop(); + sfxOpenCloset.stop(); + sfxSponge1.stop(); + sfxSponge2.stop(); + sfxTrash1.stop(); + sfxTrash2.stop(); + sfxTrash3.stop(); + sfxTrash4.stop(); + sfxUnlockPhone.stop(); + sfxVacuumRunning.stop(); + sfxVacuumStart.stop(); + sfxVacuumStop.stop(); + sfxWakeUp.stop(); + } + catch (Exception e) { + e.printStackTrace(); + } super.exit(); + //System.exit(0); } void mouseMoved() { @@ -787,7 +819,7 @@ int textHeight(String str, int specificWidth, int leading) { // anything with length 0 ignore and increment empty line count if (paragraphs[i].length() == 0) { numberEmptyLines++; - } else { + } else { numTextLines++; // word wrap String[] wordsArray = split(paragraphs[i], " "); @@ -827,8 +859,8 @@ void setCursor(PImage p) { } boolean inGame() { - return !(sceneManager.getCurrentScene() instanceof Task - || sceneManager.getCurrentScene() instanceof MainMenu + return !(sceneManager.getCurrentScene() instanceof Task + || sceneManager.getCurrentScene() instanceof MainMenu || sceneManager.getCurrentScene() instanceof IntroVideoScene || sceneManager.getCurrentScene() instanceof EndScreen); } diff --git a/data/highscores.csv b/data/highscores.csv index 25b56f7..3f5c352 100644 --- a/data/highscores.csv +++ b/data/highscores.csv @@ -1,4 +1,2 @@ score,name,time 1375808,TechnicJelle,2021/12/02 14:21 -1370498,TechnicJelle,2021/11/25 14:25 -1343170,Jelle,2021/12/02 14:04 diff --git a/menus.pde b/menus.pde index 48c7d22..259e3da 100644 --- a/menus.pde +++ b/menus.pde @@ -106,30 +106,29 @@ class IntroVideoScene extends Scene { void draw() { if (firstTime) { - //introVideo.play(); + introVideo.play(); firstTime = false; sndTheme2.stop(); - end(); } - //if (introVideo.available()) - // introVideo.read(); + if (introVideo.available()) + introVideo.read(); - //canvas.image(introVideo, 0, 0); + canvas.image(introVideo, 0, 0); - //if (introVideo.time() < 2) - // canvas.text("Press space to skip", 50, 50); + if (introVideo.time() < 2) + canvas.text("Press space to skip", 50, 50); - //if (introVideo.duration() - introVideo.time() < 0.2) { - // String s = "Objective: Clean up the house before your parents get home!\n\nPress space to start the game!"; - // canvas.fill(0); - // canvas.text(s, 52, 53); - // canvas.fill(255); - // canvas.text(s, 50, 50); - //} + if (introVideo.duration() - introVideo.time() < 0.2) { + String s = "Objective: Clean up the house before your parents get home!\n\nPress space to start the game!"; + canvas.fill(0); + canvas.text(s, 52, 53); + canvas.fill(255); + canvas.text(s, 50, 50); + } - //if (debugMode) - // println(introVideo.duration() + " - " + introVideo.time() + " = " + (introVideo.duration() - introVideo.time()), frameRate); + if (debugMode) + println(introVideo.duration() + " - " + introVideo.time() + " = " + (introVideo.duration() - introVideo.time()), frameRate); //if (introVideo.time() >= introVideo.duration() - 0.01) { // end(); @@ -141,8 +140,8 @@ class IntroVideoScene extends Scene { private void end() { try { sceneManager.goToScene("bk1beds"); - //introVideo.stop(); - //introVideo = null; //allow the gc to clear the video from memory + introVideo.stop(); + introVideo = null; //allow the gc to clear the video from memory sndTheme1.play(); if (debugMode) println("sndTheme1 dur: " + sndTheme1.duration()); } @@ -156,9 +155,9 @@ class IntroVideoScene extends Scene { } } -//void movieEvent(Movie m) { -// m.read(); -//} +void movieEvent(Movie m) { + m.read(); +} class EndScreen extends Scene {