Skip to content

Commit

Permalink
Add audio macro for ghosts
Browse files Browse the repository at this point in the history
  • Loading branch information
gerdesque committed Jan 13, 2024
1 parent a23d247 commit bc7303a
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 6 deletions.
10 changes: 10 additions & 0 deletions dist/data/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,16 @@ getTranslations = function () {
en: 'Exit the browser and open the newly added app.'
}
}
text["setup.music"] = {
"1": {
de: 'Musik',
en: 'Music'
},
"2": {
de: 'Diese App spielt Musik ab. Du kannst die Lautstärke über dein Handy regeln oder im Seitenmenü ganz ausschalten.',
en: 'This app plays music. You can adjust the volume via your cell phone or switch it off completely in the side menu.'
}
}
text["setup.player"] = {
"1": {
de: 'Setup',
Expand Down
38 changes: 32 additions & 6 deletions index.twee
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ Spuk & Schreck
--------------------------AUDIO---------------------------------------

<<cacheaudio "setup.camera" "audio/setup.camera.mp3">>
<<cacheaudio "1.hotspot.ghost" "audio/1.hotspot.ghost.mp3">>
<<cacheaudio "2.hotspot.ghost" "audio/2.hotspot.ghost.mp3">>
<<cacheaudio "click" "audio/click.mp3">>
<<cacheaudio "ring" "audio/ring.mp3">>

Expand Down Expand Up @@ -190,13 +192,8 @@ Spuk & Schreck
:: setup.init {"position":"100,300","size":"100,100"}

<<script>>

function redirectPlayer() {
$.wiki('<<goto "setup.player">>')
}

if (State.variables.is_pwa) {
redirectPlayer();
$.wiki('<<goto "setup.music">>')
};

$('#story').attr('style', 'background-image:url(images/bg.jpg)');
Expand Down Expand Up @@ -288,6 +285,22 @@ Spuk & Schreck
<button class="install"></button>
</div>

:: setup.music {"position":"100,900","size":"100,100"}

<<script>>
$('#story').attr('style', 'background-image:url(images/bg.jpg)');
<</script>>

<div class="wrapper">
<h1><<txt>></h1>
<h2><<txt>></h2>
</div>

<div class="btn-group">
<button class="retry">[[|passage()]]</button>
<button class="next">[[|setup.player]]</button>
</div>

:: setup.player {"position":"100,900","size":"100,100"}

<<script>>
Expand Down Expand Up @@ -526,6 +539,8 @@ $(document).one(":passagedisplay", function() {
});
<</script>>

<<audio "setup.camera" volume 0 fadein>>

<<set $setupCompleted to true>>

<div class="wrapper">
Expand Down Expand Up @@ -558,6 +573,8 @@ $(document).one(":passagedisplay", function() {

:: intro.init {"position":"700,500","size":"100,100"}

<<audio ":playing" stop>>

<<if $setupCompleted and $introCompleted>>
<<goto "main.storyteller">>
<<else>>
Expand Down Expand Up @@ -735,6 +752,8 @@ $(document).one(":passagedisplay", function() {
:: main.navigator [autosave] {"position":"900,700","size":"100,100"}
<div id="map"></div>

<<audio ":playing:" stop>>

<<script>>
$(document).one(":passagedisplay", function() {
requestScriptLoad({
Expand Down Expand Up @@ -832,6 +851,7 @@ $(document).one(":passagedisplay", function() {
</div>

:: main.scanner.init {"position":"1100,500","size":"100,100"}
<<audio ":playing" stop>>

<div class="wrapper">
<h1><<txt>></h1>
Expand All @@ -850,6 +870,8 @@ $(document).one(":passagedisplay", function() {
$('#story').attr('style', 'background-image:url(images/bg.jpg)');
<</script>>

<<audio ":playing:" stop>>

<div class="wrapper">
<h1><<txt>></h1>
<h2><<txt>></h2>
Expand Down Expand Up @@ -1129,6 +1151,8 @@ $(document).one(":passagedisplay", function() {
}
})
<</script>>
<<audio $$hotspot+'.'+passage() volume 0 fadein>>

<<set $inventoryNames to ['', 'herbert', 'rosa']>>
<<set $inventory[$hotspot] to $inventoryNames[$hotspot]>>

Expand Down Expand Up @@ -1191,6 +1215,8 @@ $(document).one(":passagedisplay", function() {
$('#story').attr('style', 'background-image:url(images/hotspot.jpg)');
<</script>>

<<audio ":playing:" stop>>

<div class="wrapper">
<h1><<txt 11>></h1>
<<if $riddleCorrectCount is 5>>
Expand Down

0 comments on commit bc7303a

Please sign in to comment.