diff --git a/index.html b/index.html index 6e73aa5..6ff8323 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@
- + +
+
loading...
+ +
+ - @@ -96,6 +139,7 @@ + diff --git a/scenes/act1-end.md b/scenes/act1-end.md index 12ef38a..c70b874 100644 --- a/scenes/act1-end.md +++ b/scenes/act1-end.md @@ -18,4 +18,4 @@ n: #bad# *BEING A BAD PERSON:* {{_.attack_bad}} (...2000) -`publish("END_OF_DEMO")` +`publish("END_OF_DEMO")` \ No newline at end of file diff --git a/scenes/act1.md b/scenes/act1.md index ee62f41..de77f27 100644 --- a/scenes/act1.md +++ b/scenes/act1.md @@ -26,11 +26,11 @@ n: QUICK, WARN THEM! `Game.OVERRIDE_TEXT_SPEED = 1.25;` -n4: (LET _YOUR_ WOLF COME OUT TO PLAY! PICK WHAT _YOUR_ ANXIETY WOULD BE MOST LIKELY TO SAY) +n4: (LET _YOUR_ WOLF COME OUT TO PLAY. PICK WHAT _YOUR_ ANXIETY WOULD BE MOST LIKELY TO SAY TO YOU) [You're eating alone for lunch! Again!](#act1a_alone) -[You're not productive while eating!](#act1a_study) +[You're not productive while eating!](#act1a_productive) [That white bread's bad for you!](#act1a_bread) @@ -75,20 +75,20 @@ n: YOU USED *FEAR OF BEING UNLOVED* (#act1b) -# act1a_study +# act1a_productive -b: You should multi-task and study during meals! +b: Whip out your laptop and do some work right now! `hong({eyes:"0_annoyed"})` -h: Um, I'd rather not get crumbs on my textboo-- +h: Um, I'd rather not get crumbs in my keyboa-- ``` bb({mouth:"normal", eyes:"fear"}); Game.OVERRIDE_TEXT_SPEED = 1.5; ``` -b: If you don't study you'll be expelled from college and your parents will say +b: If you're not productive you'll become a penniless parasite and your parents will say `bb({mouth:"small", eyes:"narrow"})` @@ -196,7 +196,7 @@ hong({body:"phone1", mouth:"neutral", eyes:"neutral"}) n: PROTECT YOUR HUMAN -n: FROM THE WORLD. FROM OTHER PEOPLE. FROM THEMSELVES. +n: FROM THE WORLD. FROM OTHER PEOPLE. FROM THEMSELF. n: GOOD LUCK @@ -272,7 +272,7 @@ b: So yeah you should go to that party. {{/if}} {{if _.seppuku}} -b: Just bring a textbook to study while you're there. +b: Just bring your laptop so you can do some work. {{/if}} {{if _.whitebread}} @@ -321,7 +321,7 @@ attack("10p", "harm"); (...2500) {{if _.seppuku}} -b: Besides, can't party, you need to study so your parents don't commit seppuku. +b: Besides, can't party, you need to do work so your parents don't commit seppuku. {{/if}} `hong({mouth:"anger", eyes:"anger"});` @@ -345,7 +345,7 @@ b: All you ever do is cry in a corner and worry about how loneliness is as deadl {{/if}} {{if _.seppuku}} -b: All you ever do at parties is worry about how you should be studying instead. +b: All you ever do at parties is worry about how you should be doing work instead. {{/if}} {{if _.whitebread}} @@ -836,13 +836,7 @@ bb({body:"fear"}); Game.OVERRIDE_TEXT_SPEED = 1.5; ``` -b: Do you want your freak skeleton to end up in a medical textbook?! - -`bb({eyes:"narrow"});` - -{{if _.seppuku}} -b: Though apparently you don't *read* textbooks anyway, you terrible slacker. -{{/if}} +b: Do you want your freak skeleton to end up in a cheap tourist trap museum?! ``` hong({mouth:"shock", eyes:"shock"}); @@ -1090,7 +1084,7 @@ b: They'll trap you in a well and force-feed you white bread to fatten you up so {{/if}} {{if _.seppuku}} -b: They'll bludgeon you with a textbook and slice your belly open and say "this is what you get for not studying, SEPUKKU'D" +b: They'll bludgeon you with a pomodoro timer and slice your belly open and say "this is what slackers get, SEPUKKU'D" {{/if}} {{if !_.whitebread && !_.seppuku}} @@ -1133,7 +1127,7 @@ h: i'm so sick of this game. h: {{if _.fifteencigs}}"loneliness will kill you"... {{/if}} -{{if _.seppuku}}"study or your parents will hate you"... {{/if}} +{{if _.seppuku}}"be productive or you'll be dishonored"... {{/if}} {{if _.whitebread}}"don't eat that, it'll kill you"... {{/if}} {{if _.subtweet}}"they're talking behind your back"... {{/if}} {{if _.badnews}}"the world is burning"... {{/if}} diff --git a/scenes/intro.md b/scenes/intro.md index f467bdd..17b81bc 100644 --- a/scenes/intro.md +++ b/scenes/intro.md @@ -12,7 +12,7 @@ `clearText()` -n3: Note: this is less of a "game", more of an interactive story. Hope you like reading, sucka! +n3: Welcome! This is less of a "game", more of an interactive story. Hope you like reading, sucka n3: So before we start, please choose your reading speed: @@ -29,7 +29,7 @@ n3: About as relaxing as a game about anxiety's gonna get. {{/if}} {{if Game.TEXT_SPEED==60}} -n3: Great! Defaults are everyone's favorite non-choice choice. +n3: Great! Default, the best non-choice choice. {{/if}} {{if Game.TEXT_SPEED==40}} diff --git a/scripts/game/About.js b/scripts/game/About.js new file mode 100644 index 0000000..ba54a5b --- /dev/null +++ b/scripts/game/About.js @@ -0,0 +1,14 @@ +(function(){ + +var gdpr = $("#gdpr"); +var submit = $("#submit"); +gdpr.oninput = function(){ + var isChecked = gdpr.checked; + submit.disabled = !isChecked; + submit.value = isChecked ? "Subscribe! →" : "← plz consent"; +}; +gdpr.oninput(); + +$("#the_newsletter").setAttribute("action", "https://sendy.ncase.me/subscribe"); + +})(); \ No newline at end of file diff --git a/scripts/game/Game.js b/scripts/game/Game.js index d231722..1bb4d6f 100644 --- a/scripts/game/Game.js +++ b/scripts/game/Game.js @@ -113,13 +113,17 @@ Game.update = function(){ Game.paused = false; Game.pausedDOM = $("#paused"); Game.pause = function(){ + Game.paused = true; Game.pausedDOM.style.display = "block"; Howler.mute(true); + + $("#paused").setAttribute("modal", Options.showing ? "yes" : "no" ); + }; window.addEventListener("blur", Game.pause); Game.onUnpause = function(){ - if(Game.paused){ + if(Game.paused && !Options.showing){ Game.paused = false; Game.pausedDOM.style.display = "none"; Howler.mute(false); @@ -145,6 +149,8 @@ Game.clearAllTimeouts = function(){ }; Game.canvas.addEventListener("click", Game.clearAllTimeouts); Game.canvas.addEventListener("touchstart", Game.clearAllTimeouts); +Game.choicesDOM.addEventListener("click", Game.clearAllTimeouts); +Game.choicesDOM.addEventListener("touchstart", Game.clearAllTimeouts); Game.goto = function(sectionID){ @@ -502,7 +508,7 @@ Game.executeText = function(line){ var nextLineDelay = Game.TEXT_SPEED*7; // don't override this if(dialogue.slice(-1)=="-") nextLineDelay=0; // sudden interrupt! if(Game.TEXT_SPEED<10){ // IF IT'S CLICK-TO-ADVANCE, INFINITE TIMEOUT. - nextLineDelay = 1000*1000; // one thousand seconds + nextLineDelay = 1000*10000; // ten thousand seconds } Game.setTimeout(function(){ Game.WHO_IS_SPEAKING = null; // DONE WITH IT. @@ -545,7 +551,7 @@ Game.executeChoice = function(line){ var div = document.createElement("div"); div.innerHTML = choiceText; - div.onclick = function(){ + div.onclick = function(event){ // Any pre-choice code? if(preChoiceCodeIfAny) Game.executeCode(preChoiceCodeIfAny); @@ -562,6 +568,9 @@ Game.executeChoice = function(line){ // Goto that choice, now! Game.goto(choiceID); + // STOP THE PROP + event.stopPropagation(); + }; div.onmouseover = function(){ sfx("ui_hover"); @@ -620,7 +629,7 @@ Game.executeWait = function(line){ var waitTime = parseInt(line.match(/^\(\.\.\.(\d+)\)/)[1].trim()); // Unless it's click to advance, then IGNORE ALL WAITS - if(Game.TEXT_SPEED<10){ + if(Game.TEXT_SPEED<10 && waitTime<=1000){ // hack: unless the wait is long. waitTime = 0; // TODO: Tag anim-waits, do not ignore. } @@ -669,12 +678,12 @@ Game.parseLine = function(line){ // Get the IFs, if any var lookForIfs = true; - var regex = /\{\{if[^\/]*\/if\}\}/ig; while(lookForIfs){ lookForIfs = false; // Look for an IF! + var regex = /\{\{if[^\/]*\/if\}\}/ig; // the reason it's inside here is to reset .exec var regexResult = regex.exec(line); if(regexResult){ @@ -710,12 +719,12 @@ Game.parseLine = function(line){ // Evaluate {{expressions}}, if any var lookForExpressions = true; - var regex = /\{\{[^\}]*\}\}/ig; while(lookForExpressions){ lookForExpressions = false; // Look for an IF! + var regex = /\{\{[^\}]*\}\}/ig; // the reason it's inside here is to reset .exec var regexResult = regex.exec(line); if(regexResult){ diff --git a/scripts/game/Options.js b/scripts/game/Options.js index c245b92..d7ede1a 100644 --- a/scripts/game/Options.js +++ b/scripts/game/Options.js @@ -5,13 +5,14 @@ window.Options = {}; var optionsDOM = $("#options"); var text_speed_slider = $("#text_speed_slider"); var text_speed_preview = $("#text_speed_preview"); + var volume_slider = $("#volume_slider"); var SPEED_TEXTS = [ "Show text slowlyyyyy", "Show text at a relaxed speed", "Show text at the default speed", "Show text at a brisk speed", - "INSTANT! With click-to-advance" + "All-at-once, click to advance" ]; var SPEEDS = [ 100, @@ -24,6 +25,10 @@ window.Options = {}; updateText(); }; + volume_slider.oninput = function(){ + Howler.volume(parseFloat(volume_slider.value)); + }; + /////////////////////////////////// // For previewing the text speed // /////////////////////////////////// @@ -97,7 +102,9 @@ window.Options = {}; }; updateText(); - ///////////////////////////// + /////////////////////////////////// + // Showing/hiding options ///////// + /////////////////////////////////// subscribe("show_options_bottom", function(){ @@ -111,8 +118,14 @@ window.Options = {}; }); + var ALREADY_DID_INTRO = false; $("#options_ok").onclick = function(){ - publish("cut_options_bottom"); + if(!ALREADY_DID_INTRO){ + publish("cut_options_bottom"); + ALREADY_DID_INTRO = true; + }else{ + publish("hide_options"); + } }; subscribe("cut_options_bottom", function(){ @@ -131,4 +144,18 @@ window.Options = {}; }); + subscribe("show_options", function(){ + $("#volume_options").style.display = "block"; + optionsDOM.style.top = "200px"; + Options.showing = true; + Game.pause(); + Howler.mute(false); // hack + }); + + subscribe("hide_options", function(){ + optionsDOM.style.top = ""; + Options.showing = false; + Game.onUnpause(); + }); + })(); \ No newline at end of file diff --git a/scripts/game/Sounds.js b/scripts/game/Sounds.js index 398f418..7ec744e 100644 --- a/scripts/game/Sounds.js +++ b/scripts/game/Sounds.js @@ -50,6 +50,7 @@ window.music = function(song, options){ }else{ var song = Library.sounds["music_"+song]; + song.stop(); // just in case it was playing earlier song.loop(true); if(options.fade==0){ diff --git a/scripts/intro/Intro_BG.js b/scripts/intro/Intro_BG.js index d78ccd4..8158cc6 100644 --- a/scripts/intro/Intro_BG.js +++ b/scripts/intro/Intro_BG.js @@ -123,10 +123,10 @@ function BG_Intro(){ frameTicker += 1/60; if(GAME_TRANSITION==0 || GAME_TRANSITION==1 || GAME_TRANSITION==2){ if(frameTicker>590/30){ - if(GAME_TRANSITION==0 || GAME_TRANSITION==1){ + if(GAME_TRANSITION==0){ frameTicker = 381/30; // LOOP to NOM. } - if(GAME_TRANSITION==2){ + if(GAME_TRANSITION==1 || GAME_TRANSITION==2){ // actually ew nah stop it frameTicker = 590/30; // STOP. } } diff --git a/scripts/main.js b/scripts/main.js index afdfdb1..22fc454 100644 --- a/scripts/main.js +++ b/scripts/main.js @@ -8,22 +8,11 @@ Loader.load().then(function(){ $("#loading_progress").style.display = "none"; $("#loading_done").style.display = "block"; + $("#loading").onclick = function(){ + publish('START_GAME'); + }; Game.init(); - /*Game.start(); - - Game.pause(); // just for sounds - - // Set up... - /*SceneSetup.act1(); - publish("hp_show"); - hong({body:"phone1", mouth:"neutral", eyes:"neutral"}); - _.whitebread = true;*/ - - // GO! - //music('battle', 0.5); - //Game.goto("act1f"); - //Game.goto("intro"); }); @@ -32,11 +21,16 @@ subscribe("START_GAME", function(){ $("#loading").style.display = "none"; Game.start(); - SceneSetup.act1(); + /*SceneSetup.act1(); music('battle', {volume:0.5}); hong({body:"phone1"}); - Game.goto("act1h"); + + _.seppuku = true; + _.hookuphole = true; + _.catmilk = true; + + Game.goto("act1g");*/ - //Game.goto("act1"); + Game.goto("intro"); }); \ No newline at end of file diff --git a/styles/game.css b/styles/game.css index c118b19..87c1c3a 100644 --- a/styles/game.css +++ b/styles/game.css @@ -13,7 +13,7 @@ MAIN GAME ******************************************************************************************************/ -#game_words, #game_choices, #paused{ +#game_words, #game_choices, #paused, #options, #loading, #gear, #about{ -webkit-user-select: none; /* Safari 3.1+ */ -moz-user-select: none; /* Firefox 2+ */ -ms-user-select: none; /* IE 10+ */ @@ -45,6 +45,10 @@ MAIN GAME overflow: hidden; } +#game_words, #game_hp{ + pointer-events: none; +} + /****************************************************************************************************** @@ -127,6 +131,12 @@ PAUSED & LOADING width: 220px; margin: 15px auto; } +#paused[modal=yes]{ + background: rgba(70,70,70,0.9); +} +#paused[modal=yes] > div{ + display: none; +} #loading{ display:block; @@ -177,11 +187,118 @@ ABOUT / END DEMO #end_demo_words a:hover{ color: #ff8080; } +#end_demo a.no_deco{ + text-decoration: none; +} + +#the_newsletter #email{ + width: 300px; + font-size: 20px; + border: none; + padding: 5px; + font-weight: 300; + margin-top: 10px; + border-radius: 5px; +} +#the_newsletter #email_info{ + position: relative; + width: 310px; + height: 60px; +} +#the_newsletter #gdpr{ + position: absolute; + transform: scale(2); + top: 11px; + left: 3px; +} +#the_newsletter #consent{ + font-size: 13px; + position: absolute; + left: 31px; + top: 8px; + width: 110px; + line-height: 1em; + text-align: left; +} +#the_newsletter #submit{ + background: #ff4040; + position: absolute; + top: 6px; + left: 150px; + width: 160px; + height: 30px; + font-size: 20px; + font-weight: 300; + border-radius: 30px; + border: none; + color: #ffffff; + cursor: pointer; +} +#the_newsletter #submit:hover{ + background: #ff7070; +} +#the_newsletter #submit[disabled]{ + background: #555; + color: #222; + cursor: default; +} + #patreon{ - width:200px; height:60px; + width: 160px; + height: 48px; background: url(../sprites/end_demo/patreon.png); background-size: 100%; - margin: 5px auto 15px auto; + margin: 5px auto 10px auto; + cursor: pointer; + position: relative; +} +#patreon:hover{ + top:-2px; +} + +#share{ + overflow: hidden; + text-align: center; + padding: 2px 0; + margin-bottom: 3px; +} +#share div{ + display: inline-block; + overflow: hidden; + width:40px; height:40px; + background: url(../sprites/end_demo/share.png); + background-size: 300%; + position: relative; + cursor: pointer; +} +#share div:hover{ + top:-2px; +} +#share #share_fb{ + background-position: 0px; +} +#share #share_tw{ + background-position: -40px; +} +#share #share_em{ + background-position: -80px; +} + +#replay{ + width:100px; + height: 80px; + background: url(../sprites/end_demo/replay.png); + background-size: 300%; + position: absolute; + bottom: 0; + left: 130px; + cursor: pointer; +} +#replay:hover{ + background-position: -100px; +} +#replay:active{ + background-position: -200px; } @@ -196,10 +313,12 @@ OPTIONS top: 600px; width: 300px; - background: #2e2e2e; padding: 15px; margin: 15px; + background: #2e2e2e; + color:#fff; + /* Spring OUT only */ -webkit-transition: top 500ms cubic-bezier(0.350, 0.005, 0.370, 1); /* older webkit */ -webkit-transition: top 500ms cubic-bezier(0.350, 0.005, 0.370, 1.390); @@ -215,7 +334,6 @@ OPTIONS } #text_speed_preview{ - color:#fff; height: 1.3em; } #options_ok{ diff --git a/test.html b/test.html new file mode 100644 index 0000000..d842cf0 --- /dev/null +++ b/test.html @@ -0,0 +1,15 @@ +
+ +

+ + + I consent to 1 ✉️ per ~2 months, that's it + +
+
+ +
+ + + +
\ No newline at end of file