master
*anna* 3 years ago
parent a777fb6b02
commit c7647d23d9

@ -9,6 +9,12 @@
</head> </head>
<body > <body >
<audio loop="loop" id="theme" preload="auto"><source src="sound/theme3_danger.mp3" type="audio/mp3"></audio>
<audio id="click"><source src="sound/click.wav" type="audio/wav"></audio>
<audio id="comic"><source src="sound/alien_speech.wav" type="audio/wav"></audio>
<audio id="yes"><source src="sound/yes.wav" type="audio/wav"></audio>
<audio id="smoke"><source src="sound/smoke.wav" type="audio/wav"></audio>
<audio id="shot"><source src="sound/shot.wav" type="audio/wav"></audio>
<div class="game_bar invert" style="display: none;"> <div class="game_bar invert" style="display: none;">
cat steaks: <span class="cat_meat_bar"></span> / 4 cat steaks: <span class="cat_meat_bar"></span> / 4
@ -128,10 +134,25 @@
</div> </div>
<script src="jquery.min.js"></script> <script src="jquery.min.js"></script>
<script> <script>
var theme = document.querySelector("#theme");
var click = document.querySelector("#click");
var comic = document.querySelector("#comic");
var yes = document.querySelector("#yes");
var shot = document.querySelector("#shot");
var smoke = document.querySelector("#smoke");
$("body").hover( function() {
theme.play();
theme.addEventListener('paused',function() {
theme.play();
},false);
})
// saves game step in the local storage // saves game step in the local storage
window.onload = function() { window.onload = function() {
theme.play();
window.localStorage.setItem("bus_station","opened"); window.localStorage.setItem("bus_station","opened");
console.log ("bus station:",localStorage.bus_station); console.log ("bus station:",localStorage.bus_station);
} }
@ -239,6 +260,7 @@ $(document).keydown(function(e) {
var click_counter = 0; var click_counter = 0;
$("#person1").click(function () { $("#person1").click(function () {
click.play();
click_counter ++; click_counter ++;
$("#person1").hide(); $("#person1").hide();
$("#saurian1").show(); $("#saurian1").show();
@ -246,6 +268,7 @@ $(document).keydown(function(e) {
}); });
$("#person2").click(function () { $("#person2").click(function () {
click.play();
click_counter ++; click_counter ++;
$("#person2").hide(); $("#person2").hide();
$("#saurian2").show(); $("#saurian2").show();
@ -253,6 +276,7 @@ $(document).keydown(function(e) {
}); });
$("#person3").click(function () { $("#person3").click(function () {
click.play();
click_counter ++; click_counter ++;
$("#person3").hide(); $("#person3").hide();
$("#saurian3").show(); $("#saurian3").show();
@ -260,6 +284,7 @@ $(document).keydown(function(e) {
}); });
$("#person4").click(function () { $("#person4").click(function () {
click.play();
click_counter ++; click_counter ++;
$("#person4").hide(); $("#person4").hide();
$("#saurian4").show(); $("#saurian4").show();
@ -272,24 +297,30 @@ $(document).keydown(function(e) {
function reach_counter() { function reach_counter() {
if ( click_counter == 4 ) { if ( click_counter == 4 ) {
$(".bubble1").show(); $(".bubble1").show();
comic.play();
setTimeout( function () { setTimeout( function () {
comic.play();
$(".bubble2").show(); $(".bubble2").show();
setTimeout( function () { setTimeout( function () {
click.play();
$(".message2,.message1").hide(); $(".message2,.message1").hide();
$(".message3, .game_bar, .meat").show(); $(".message3, .game_bar, .meat").show();
}, 2000); }, 2000);
}, 2000); }, 3000);
}; };
} }
$(".bubble1").click(function () { $(".bubble1").click(function () {
click.play();
$(".bubble1").toggle(); $(".bubble1").toggle();
}); });
$(".bubble2").click(function () { $(".bubble2").click(function () {
click.play();
$(".bubble2").toggle(); $(".bubble2").toggle();
}); });
$("#meat1").click(function () { $("#meat1").click(function () {
console.log ("ora!") console.log ("ora!")
yes.play();
$("#meat1").animate({ left: "89%"}, { $("#meat1").animate({ left: "89%"}, {
duration: 300 duration: 300
}).promise().done(function(){ }).promise().done(function(){
@ -301,6 +332,7 @@ $(document).keydown(function(e) {
}); });
$("#meat2").click(function () { $("#meat2").click(function () {
yes.play();
console.log ("ora!") console.log ("ora!")
$("#meat2").animate({ left: "87%"}, { $("#meat2").animate({ left: "87%"}, {
duration: 300 duration: 300
@ -313,6 +345,7 @@ $(document).keydown(function(e) {
}); });
$("#meat3").click(function () { $("#meat3").click(function () {
yes.play();
console.log ("ora!") console.log ("ora!")
$("#meat3").animate({ left: "95%"}, { $("#meat3").animate({ left: "95%"}, {
duration: 300 duration: 300
@ -324,6 +357,7 @@ $(document).keydown(function(e) {
}); });
}); });
$("#meat4").click(function () { $("#meat4").click(function () {
yes.play();
console.log ("ora!") console.log ("ora!")
$("#meat4").animate({ left: "88%"}, { $("#meat4").animate({ left: "88%"}, {
duration: 300 duration: 300
@ -341,8 +375,10 @@ function check_meat() {
} if (cat_meat == 0) { } if (cat_meat == 0) {
console.log("carne finita"); console.log("carne finita");
$(".game_bar").addClass("game_bar_glow"); $(".game_bar").addClass("game_bar_glow");
click.play();
setTimeout( function() { setTimeout( function() {
$(".game_bar").hide(); $(".game_bar").hide();
smoke.play();
$(".figure3").animate({ left: "90%"}, { $(".figure3").animate({ left: "90%"}, {
duration: 500 duration: 500
}).promise().done(function(){ }).promise().done(function(){
@ -357,63 +393,74 @@ function check_meat() {
function enter() { function enter() {
$("#fighter1").hide(); $("#fighter1").hide();
$("#tunnel1").show(); $("#tunnel1").show();
smoke.play();
$("#tunnel1").animate({ top: "100%"}, { $("#tunnel1").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel1").hide(); $("#tunnel1").hide();
$("#fighter2").hide(); $("#fighter2").hide();
$("#tunnel2").show(); $("#tunnel2").show();
$("#tunnel2").animate({ top: "100%"}, { $("#tunnel2").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel2").hide(); $("#tunnel2").hide();
$("#fighter3").hide(); $("#fighter3").hide();
$("#tunnel3").show(); $("#tunnel3").show();
$("#tunnel3").animate({ top: "100%"}, { $("#tunnel3").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel3").hide(); $("#tunnel3").hide();
$("#fighter4").hide(); $("#fighter4").hide();
$("#tunnel4").show(); $("#tunnel4").show();
$("#tunnel4").animate({ top: "100%"}, { $("#tunnel4").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel4").hide(); $("#tunnel4").hide();
$("#fighter5").hide(); $("#fighter5").hide();
$("#tunnel5").show(); $("#tunnel5").show();
$("#tunnel5").animate({ top: "100%"}, { $("#tunnel5").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel5").hide(); $("#tunnel5").hide();
$("#fighter6").hide(); $("#fighter6").hide();
$("#tunnel6").show(); $("#tunnel6").show();
$("#tunnel6").animate({ top: "100%"}, { $("#tunnel6").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel6").hide(); $("#tunnel6").hide();
$("#fighter7").hide(); $("#fighter7").hide();
$("#tunnel7").show(); $("#tunnel7").show();
$("#tunnel7").animate({ top: "100%"}, { $("#tunnel7").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel7").hide(); $("#tunnel7").hide();
$("#fighter8").hide(); $("#fighter8").hide();
$("#tunnel8").show(); $("#tunnel8").show();
$("#tunnel8").animate({ top: "100%"}, { $("#tunnel8").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel8").hide(); $("#tunnel8").hide();
$("#fighter9").hide(); $("#fighter9").hide();
$("#tunnel9").show(); $("#tunnel9").show();
$("#tunnel9").animate({ top: "100%"}, { $("#tunnel9").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#tunnel9").hide(); $("#tunnel9").hide();
$(".army").hide(); $(".army").hide();
$("#player_img").show(); $("#player_img").show();
$("#player_img").animate({ top: "100%"}, { $("#player_img").animate({ top: "100%"}, {
duration: 1000 duration: 1000
}).promise().done(function(){ }).promise().done(function(){
smoke.play();
$("#player_img").hide(); $("#player_img").hide();
$(".tunnel").hide(); $(".tunnel").hide();
setTimeout( function (){ setTimeout( function (){

@ -9,6 +9,14 @@
</head> </head>
<body> <body>
<audio loop="loop" id="theme2" preload="auto"><source src="sound/theme2.wav" type="audio/wav"></audio>
<audio loop="loop" id="theme4" preload="auto"><source src="sound/theme4_scary.wav" type="audio/wav"></audio>
<audio id="click"><source src="sound/click.wav" type="audio/wav"></audio>
<audio id="comic"><source src="sound/speech.wav" type="audio/wav"></audio>
<audio id="yes"><source src="sound/yes.wav" type="audio/wav"></audio>
<audio id="no"><source src="sound/no.wav" type="audio/wav"></audio>
<audio id="shot"><source src="sound/shot.wav" type="audio/wav"></audio>
<div id="cover"></div> <div id="cover"></div>
<div id="ground"class="invert"></div> <div id="ground"class="invert"></div>
<svg class="invert"> <svg class="invert">
@ -85,22 +93,39 @@
</div> </div>
<!--game bar--> <!--game bar-->
<div class="game_bar" style="display: none;"> <div class="game_bar invert" style="display: none;">
cat steaks: <span class="cat_meat_bar"></span> / 4 cat steaks: <span class="cat_meat_bar"></span> / 4
</div> </div>
<script src="jquery.min.js"></script> <script src="jquery.min.js"></script>
<script> <script>
var theme = document.querySelector("#theme2");
var scary = document.querySelector("#theme4");
var click = document.querySelector("#click");
var comic = document.querySelector("#comic");
var no = document.querySelector("#no");
var yes = document.querySelector("#yes");
var shot = document.querySelector("#shot");
$("body").hover( function() {
if (cat_meat < 4) {
theme.play();
theme.addEventListener('paused',function() {
theme.play();
},false);
}
})
// saves game step in the local storage // saves game step in the local storage
window.onload = function() { window.onload = function() {
window.localStorage.setItem("butchery","opened"); theme.play();
console.log ("butcher store:",localStorage.butchery); comic.play();
$('.cat_meat_bar').html(cat_meat); window.localStorage.setItem("butchery","opened");
} console.log ("butcher store:",localStorage.butchery);
$('.cat_meat_bar').html(cat_meat);
}
//get player avatar from local storage //get player avatar from local storage
console.log (localStorage.myavatar) console.log (localStorage.myavatar)
@ -115,6 +140,7 @@
$(".bubble1").toggle(); $(".bubble1").toggle();
$(".message1").hide(); $(".message1").hide();
$(".message2, .game_bar").show(); $(".message2, .game_bar").show();
click.play();
setTimeout( function() { setTimeout( function() {
$("#cover").css('z-index',-5); $("#cover").css('z-index',-5);
$(".tables").css('cursor', 'pointer'); $(".tables").css('cursor', 'pointer');
@ -130,6 +156,7 @@
var weapon = $("#pill"); var weapon = $("#pill");
$("#table1").click (function(){ $("#table1").click (function(){
no.play();
$("#table1").addClass("touch_animation"); $("#table1").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table1").removeClass("touch_animation"); $("#table1").removeClass("touch_animation");
@ -140,6 +167,7 @@
}); });
$("#table2").click (function(){ $("#table2").click (function(){
no.play();
$("#table2").addClass("touch_animation"); $("#table2").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table2").removeClass("touch_animation"); $("#table2").removeClass("touch_animation");
@ -150,6 +178,7 @@
}); });
$("#table3").click (function(){ $("#table3").click (function(){
yes.play();
$("#table3").attr("src", "imgs/butchery/cat.gif"); $("#table3").attr("src", "imgs/butchery/cat.gif");
setTimeout(function(){ setTimeout(function(){
$("#table3").removeClass("touch_animation"); $("#table3").removeClass("touch_animation");
@ -161,6 +190,7 @@
}); });
$("#table4").click (function(){ $("#table4").click (function(){
no.play();
$("#table4").addClass("touch_animation"); $("#table4").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table4").removeClass("touch_animation"); $("#table4").removeClass("touch_animation");
@ -171,6 +201,7 @@
}); });
$("#table5").click (function(){ $("#table5").click (function(){
no.play();
$("#table5").addClass("touch_animation"); $("#table5").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table5").removeClass("touch_animation"); $("#table5").removeClass("touch_animation");
@ -181,6 +212,7 @@
}); });
$("#table6").click (function(){ $("#table6").click (function(){
no.play();
$("#table6").addClass("touch_animation"); $("#table6").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table6").removeClass("touch_animation"); $("#table6").removeClass("touch_animation");
@ -191,6 +223,7 @@
}); });
$("#table7").click (function(){ $("#table7").click (function(){
yes.play();
$("#table7").attr("src", "imgs/butchery/cat.gif"); $("#table7").attr("src", "imgs/butchery/cat.gif");
setTimeout(function(){ setTimeout(function(){
$("#table7").removeClass("touch_animation"); $("#table7").removeClass("touch_animation");
@ -202,6 +235,7 @@
}); });
$("#table8").click (function(){ $("#table8").click (function(){
no.play();
$("#table8").addClass("touch_animation"); $("#table8").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table8").removeClass("touch_animation"); $("#table8").removeClass("touch_animation");
@ -212,6 +246,7 @@
}); });
$("#table9").click (function(){ $("#table9").click (function(){
no.play();
$("#table9").addClass("touch_animation"); $("#table9").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table9").removeClass("touch_animation"); $("#table9").removeClass("touch_animation");
@ -222,6 +257,7 @@
}); });
$("#table10").click (function(){ $("#table10").click (function(){
yes.play();
$("#table10").attr("src", "imgs/butchery/cat.gif"); $("#table10").attr("src", "imgs/butchery/cat.gif");
setTimeout(function(){ setTimeout(function(){
$("#table10").removeClass("touch_animation"); $("#table10").removeClass("touch_animation");
@ -233,6 +269,7 @@
}); });
$("#table11").click (function(){ $("#table11").click (function(){
yes.play();
$("#table11").attr("src", "imgs/butchery/cat.gif"); $("#table11").attr("src", "imgs/butchery/cat.gif");
setTimeout(function(){ setTimeout(function(){
$("#table11").removeClass("touch_animation"); $("#table11").removeClass("touch_animation");
@ -244,6 +281,7 @@
}); });
$("#table12").click (function(){ $("#table12").click (function(){
no.play();
$("#table12").addClass("touch_animation"); $("#table12").addClass("touch_animation");
setTimeout(function(){ setTimeout(function(){
$("#table12").removeClass("touch_animation"); $("#table12").removeClass("touch_animation");
@ -259,12 +297,16 @@
$("#cover").css("z-index",40); $("#cover").css("z-index",40);
console.log ("you won!"); console.log ("you won!");
$(".message2").hide(); $(".message2").hide();
$(".game_bar").removeClass("invert");
$(".game_bar").addClass("game_bar_glow"); $(".game_bar").addClass("game_bar_glow");
setTimeout( function (){ setTimeout( function (){
$(".invert").addClass("invert_style"); $(".invert").addClass("invert_style");
theme.pause();
scary.play();
$("#butcher").show(); $("#butcher").show();
setTimeout( function (){ setTimeout( function (){
$("#knife").show(); $("#knife").show();
shot.play();
$("#knife").animate({left:'20%'}, { $("#knife").animate({left:'20%'}, {
duration : 500 duration : 500
}).promise().done(function(){ }).promise().done(function(){
@ -272,10 +314,14 @@
$("#pat").attr("src", "imgs/butchery/parrot_r.gif"); $("#pat").attr("src", "imgs/butchery/parrot_r.gif");
$("#pat").height(85); $("#pat").height(85);
$(".message_won").show(); $(".message_won").show();
click.play();
setTimeout( function (){ setTimeout( function (){
$(".bubble2").show(); $(".bubble2").show();
comic.play();
$("#butcher").hide(); $("#butcher").hide();
$(".invert").removeClass("invert_style"); $(".invert").removeClass("invert_style");
scary.pause();
theme.play();
}, 5000) }, 5000)
}); });
}, 300); }, 300);
@ -283,22 +329,27 @@
}; };
$(".bubble2").click(function(){ $(".bubble2").click(function(){
comic.play();
$(".bubble2").hide(); $(".bubble2").hide();
$(".bubble3").show(); $(".bubble3").show();
setTimeout( function (){ setTimeout( function (){
$("#pat").attr("src", "imgs/butchery/parrot_d.png"); $("#pat").attr("src", "imgs/butchery/parrot_d.png");
$(".message_won").hide(); $(".message_won").hide();
$(".message_final").show(); $(".message_final").show();
click.play();
}, 2000) }, 2000)
}); });
$(".bubble3").click(function(){ $(".bubble3").click(function(){
click.play();
$(".bubble3").hide(); $(".bubble3").hide();
}); });
if (error == 3) { if (error == 3) {
setTimeout (function() { setTimeout (function() {
theme.pause();
scary.play();
$("#cover").css("z-index",40); $("#cover").css("z-index",40);
console.log ("you lost!"); console.log ("you lost!");
$(".message_won, .message2").hide(); $(".message_won, .message2").hide();
@ -306,17 +357,21 @@
$("#butcher, #thunder").show(); $("#butcher, #thunder").show();
setTimeout( function (){ setTimeout( function (){
$(".message_lost").show(); $(".message_lost").show();
click.play();
}, 1000); }, 1000);
}, 600); }, 600);
}; };
}; };
$("#try_again").click( function (){ $("#try_again").click( function (){
theme.play();
scary.pause();
cat_meat=0; cat_meat=0;
error=0; error=0;
$('.cat_meat_bar').html(cat_meat); $('.cat_meat_bar').html(cat_meat);
$(".message_lost, #butcher, #thunder").hide(); $(".message_lost, #butcher, #thunder").hide();
$(".message2").show(); $(".message2").show();
click.play();
$("#cover").css("z-index",-5); $("#cover").css("z-index",-5);
$(".invert").removeClass("invert_style"); $(".invert").removeClass("invert_style");
$(".tables").attr("src", "imgs/butchery/meat1.gif"); $(".tables").attr("src", "imgs/butchery/meat1.gif");

@ -10,6 +10,11 @@
</head> </head>
<body> <body>
<audio loop="loop" id="theme2" preload="auto"><source src="sound/theme2.wav" type="audio/wav"></audio>
<audio id="click"><source src="sound/click.wav" type="audio/wav"></audio>
<audio id="comic"><source src="sound/speech.wav" type="audio/wav"></audio>
<audio id="no"><source src="sound/no.wav" type="audio/wav"></audio>
<audio id="smoke"><source src="sound/smoke.wav" type="audio/wav"></audio>
<div id="groundline"></div> <div id="groundline"></div>
@ -70,7 +75,19 @@
<script src="jquery.min.js"></script> <script src="jquery.min.js"></script>
<script> <script>
var theme = document.querySelector("#theme2");
var click = document.querySelector("#click");
var comic = document.querySelector("#comic");
var no = document.querySelector("#no");
var smoke = document.querySelector("#smoke");
$("body").hover( function() {
theme.play();
theme.addEventListener('paused',function() {
theme.play();
},false);
})
//get player avatar from local storage //get player avatar from local storage
console.log (localStorage.myavatar) console.log (localStorage.myavatar)
@ -82,6 +99,7 @@
//store that you've been in the park //store that you've been in the park
window.onload = function() { window.onload = function() {
theme.play();
window.localStorage.setItem("cat_shelter_page","opened") window.localStorage.setItem("cat_shelter_page","opened")
console.log ("cat shelter:",localStorage.cat_shelter_page) console.log ("cat shelter:",localStorage.cat_shelter_page)
} }
@ -89,6 +107,7 @@
var house_counter = 0; var house_counter = 0;
$("#house1").click(function(){ $("#house1").click(function(){
no.play();
$("#house1").addClass("touch_animation"); $("#house1").addClass("touch_animation");
setTimeout( function(){ setTimeout( function(){
$("#house5").removeClass("touch_animation"); $("#house5").removeClass("touch_animation");
@ -99,9 +118,11 @@
}); });
$("#house2").click(function(){ $("#house2").click(function(){
no.play();
$("#house2").addClass("touch_animation"); $("#house2").addClass("touch_animation");
setTimeout( function(){ setTimeout( function(){
$("#house2").removeClass("touch_animation"); $("#house2").removeClass("touch_animation");
smoke.play();
},500); },500);
house_counter ++; house_counter ++;
console.log(house_counter); console.log(house_counter);
@ -115,9 +136,11 @@
}); });
$("#house3").click(function(){ $("#house3").click(function(){
no.play();
$("#house3").addClass("touch_animation"); $("#house3").addClass("touch_animation");
setTimeout( function(){ setTimeout( function(){
$("#house3").removeClass("touch_animation"); $("#house3").removeClass("touch_animation");
smoke.play();
},500); },500);
house_counter ++; house_counter ++;
console.log(house_counter); console.log(house_counter);
@ -132,6 +155,7 @@
$("#house4").click(function(){ $("#house4").click(function(){
$("#house4").addClass("touch_animation"); $("#house4").addClass("touch_animation");
no.play();
setTimeout( function(){ setTimeout( function(){
$("#house4").removeClass("touch_animation"); $("#house4").removeClass("touch_animation");
},500); },500);
@ -141,6 +165,7 @@
}); });
$("#house5").click(function(){ $("#house5").click(function(){
no.play();
$("#house5").addClass("touch_animation"); $("#house5").addClass("touch_animation");
setTimeout( function(){ setTimeout( function(){
$("#house5").removeClass("touch_animation"); $("#house5").removeClass("touch_animation");
@ -152,8 +177,10 @@
$("#house6").click(function(){ $("#house6").click(function(){
$("#house6").addClass("touch_animation"); $("#house6").addClass("touch_animation");
no.play();
setTimeout( function(){ setTimeout( function(){
$("#house6").removeClass("touch_animation"); $("#house6").removeClass("touch_animation");
smoke.play();
},500); },500);
house_counter ++; house_counter ++;
console.log(house_counter); console.log(house_counter);
@ -171,6 +198,8 @@
setTimeout(function(){ setTimeout(function(){
console.log("hei"); console.log("hei");
$("#pat").show(); $("#pat").show();
smoke.play();
comic.play();
setTimeout(function(){ setTimeout(function(){
$(".bubble1").show(); $(".bubble1").show();
setTimeout(function(){ setTimeout(function(){
@ -181,38 +210,42 @@
} }
} }
$(".bubble1").click(function(){ $(".bubble1").click(function(){
comic.play();
$(".bubble1").hide(); $(".bubble1").hide();
$(".bubble2").show(); $(".bubble2").show();
$(".message2").show(); $(".message2").show();
click.play();
}); });
$(".bubble2").click(function(){ $(".bubble2").click(function(){
comic.play();
$(".bubble2").hide(); $(".bubble2").hide();
$(".bubble3").show(); $(".bubble3").show();
}); });
$(".bubble3").click(function(){ $(".bubble3").click(function(){
comic.play();
$(".bubble3").hide(); $(".bubble3").hide();
$(".bubble4").show(); $(".bubble4").show();
}); });
$(".bubble4").click(function(){ $(".bubble4").click(function(){
comic.play();
$(".bubble4").hide(); $(".bubble4").hide();
$(".bubble5").show(); $(".bubble5").show();
}); });
$(".bubble5").click(function(){
$(".bubble5").hide();
$(".bubble6").show();
});
$(".bubble5").click(function(){ $(".bubble5").click(function(){
comic.play();
click.play();
$(".bubble5, .message2").hide(); $(".bubble5, .message2").hide();
$(".bubble6").show(); $(".bubble6").show();
$(".message3").show(); $(".message3").show();
}); });
$(".bubble6").click(function(){ $(".bubble6").click(function(){
click.play();
$(".bubble6").hide(); $(".bubble6").hide();
}); });

@ -8,6 +8,9 @@
<link rel="stylesheet" href="final.css"> <link rel="stylesheet" href="final.css">
</head> </head>
<body> <body>
<audio id="amanda_theme"><source src="sound/amanda_theme.wav" type="audio/wav"></audio>
<audio id="click"><source src="sound/click.wav" type="audio/wav"></audio>
<span id="info_button" class="blur" ></span> <span id="info_button" class="blur" ></span>
<div id="info_text" style="display: none;"> <div id="info_text" style="display: none;">
<span class="title">When you might go astray</span> is a research project dealing with conspiracy theories, fictional narratives, and how the mutuality between the two shapes the stories of their believers. <span class="title">When you might go astray</span> is a research project dealing with conspiracy theories, fictional narratives, and how the mutuality between the two shapes the stories of their believers.
@ -193,6 +196,9 @@ I wanted to leave you with something to think about when you'll be outside (<img
<script src="jquery.min.js"></script> <script src="jquery.min.js"></script>
<script> <script>
//audio
var amanda = document.querySelector("#amanda_theme");
var click = document.querySelector("#click");
//player name //player name
document.querySelector('#player_name').innerHTML =localStorage.playerName; document.querySelector('#player_name').innerHTML =localStorage.playerName;
@ -207,7 +213,7 @@ var img = document.createElement("img");
//checks story development //checks story development
window.onload = function (){ window.onload = function (){
amanda.play();
//remembers that you reached the end of the game //remembers that you reached the end of the game
window.localStorage.setItem("final","opened"); window.localStorage.setItem("final","opened");
console.log ("final:",localStorage.final) console.log ("final:",localStorage.final)
@ -348,10 +354,19 @@ window.onload = function (){
// buttons // buttons
$("#info_button").click( function () { $("#info_button").click( function () {
$("#info_text").toggle(); $("#info_text").toggle();
click.play();
}); });
$(".amanda_intro").click( function () { $(".amanda_intro").click( function () {
$(".amanda_intro, #amanda, #cloud, #cloud2").hide(); $(".amanda_intro, #amanda, #cloud, #cloud2").hide();
click.play();
});
$("a").click( function () {
click.play();
});
$("body").hover( function () {
amanda.play();
}); });

@ -9,6 +9,10 @@
</head> </head>
<body > <body >
<audio loop="loop" id="theme2" preload="auto"><source src="sound/theme2.wav" type="audio/wav"></audio>
<audio loop="loop" id="theme4" preload="auto"><source src="sound/theme4_scary.wav" type="audio/wav"></audio>
<audio id="click"><source src="sound/click.wav" type="audio/wav"></audio>
<audio id="comic"><source src="sound/speech.wav" type="audio/wav"></audio>
<div id="ground_color" class="to_invert"></div> <div id="ground_color" class="to_invert"></div>
@ -97,10 +101,24 @@
<script src="jquery.min.js"></script> <script src="jquery.min.js"></script>
<script> <script>
var theme = document.querySelector("#theme2");
var scary = document.querySelector("#theme4");
var click = document.querySelector("#click");
var comic = document.querySelector("#comic");
$("body").hover( function() {
theme.play();
theme.addEventListener('paused',function() {
theme.play();
},false);
})
// saves game step in the local storage // saves game step in the local storage
window.onload = function() { window.onload = function() {
theme.play();
window.localStorage.setItem("major_house","opened"); window.localStorage.setItem("major_house","opened");
console.log ("major house:",localStorage.major_house); console.log ("major house:",localStorage.major_house);
} }
@ -161,12 +179,14 @@ $(document).keydown(function(e) {
} }
else { else {
click.play();
console.log("70 ora") console.log("70 ora")
$(document).scrollLeft(8000); $(document).scrollLeft(8000);
$(".message1").hide(); $(".message1").hide();
$(".message2").show(); $(".message2").show();
setTimeout( function() { setTimeout( function() {
$('.bubble1').show(); $('.bubble1').show();
comic.play();
setTimeout( function() { setTimeout( function() {
$('.glasses_bar').show(); $('.glasses_bar').show();
$('.glasses_bar').addClass("glass_appear"); $('.glasses_bar').addClass("glass_appear");
@ -202,6 +222,9 @@ $(document).keydown(function(e) {
}) })
$('.glasses_bar').click ( function(){ $('.glasses_bar').click ( function(){
theme.pause();
scary.play();
comic.play();
$('.to_invert').toggleClass("invert"); $('.to_invert').toggleClass("invert");
$('.glasses_bar').toggleClass("glasses_bar_black"); $('.glasses_bar').toggleClass("glasses_bar_black");
$('.good').toggle(); $('.good').toggle();
@ -213,10 +236,12 @@ $(document).keydown(function(e) {
}) })
$('.bubble1').click(function(){ $('.bubble1').click(function(){
click.play();
$('.bubble1').hide(); $('.bubble1').hide();
}); });
$('.bubble2').click(function(){ $('.bubble2').click(function(){
click.play();
$('.bubble2').hide(); $('.bubble2').hide();
}); });

@ -9,6 +9,15 @@
</head> </head>
<body > <body >
<audio loop="loop" id="theme" preload="auto"><source src="sound/theme6_march.wav" type="audio/wav"></audio>
<audio id="click"><source src="sound/click.wav" type="audio/wav"></audio>
<audio id="comic"><source src="sound/speech.wav" type="audio/wav"></audio>
<audio id="appear"><source src="sound/appear.wav" type="audio/wav"></audio>
<audio id="amanda_theme"><source src="sound/amanda_theme.wav" type="audio/wav"></audio>
<audio id="smoke"><source src="sound/smoke.wav" type="audio/wav"></audio>
<audio id="explosion"><source src="sound/explosion.wav" type="audio/wav"></audio>
<svg class="invert blur"> <svg class="invert blur">
<line x1="-10" y1="70" x2="68%" y2="70"/> <line x1="-10" y1="70" x2="68%" y2="70"/>
<line x1="68%" y1="70" x2="68%" y2="-10"/> <line x1="68%" y1="70" x2="68%" y2="-10"/>
@ -139,32 +148,61 @@
<script src="jquery.min.js"></script> <script src="jquery.min.js"></script>
<script> <script>
var theme = document.querySelector("#theme");
var click = document.querySelector("#click");
var comic = document.querySelector("#comic");
var shot = document.querySelector("#shot");
var smoke = document.querySelector("#smoke");
var explosion = document.querySelector("#explosion");
var appear = document.querySelector("#appear");
var amanda = document.querySelector("#amanda_theme");
$("body").hover( function() {
if ( shooting_counter < 10 ){
theme.play();
theme.addEventListener('paused',function() {
theme.play();
},false);
}
})
// saves game step in the local storage // saves game step in the local storage
window.onload = function() { window.onload = function() {
theme.play();
window.localStorage.setItem("saurians_headquarter","opened"); window.localStorage.setItem("saurians_headquarter","opened");
console.log ("saurians headquarter:",localStorage.saurians_headquarter); console.log ("saurians headquarter:",localStorage.saurians_headquarter);
setTimeout(function() { setTimeout(function() {
smoke.play();
$("#player_img").show(); $("#player_img").show();
setTimeout(function() { setTimeout(function() {
smoke.play();
$("#fighter1").show(); $("#fighter1").show();
setTimeout(function() { setTimeout(function() {
smoke.play();
$("#fighter2").show(); $("#fighter2").show();
setTimeout(function() { setTimeout(function() {
smoke.play();
$("#fighter3").show(); $("#fighter3").show();
setTimeout(function() { setTimeout(function() {
smoke.play();
$("#fighter4").show(); $("#fighter4").show();
setTimeout(function() { setTimeout(function() {
smoke.play();
$("#fighter5").show(); $("#fighter5").show();
setTimeout(function() { setTimeout(function() {
smoke.play();
$("#fighter6").show(); $("#fighter6").show();
setTimeout(function() { setTimeout(function() {
$("#fighter7").show(); $("#fighter7").show();
smoke.play();
setTimeout(function() { setTimeout(function() {
$("#fighter8").show(); $("#fighter8").show();
smoke.play();
setTimeout(function() { setTimeout(function() {
$("#fighter9").show(); $("#fighter9").show();
smoke.play();
},500); },500);
},500); },500);
},500); },500);
@ -190,6 +228,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
var shooting_counter = 0; var shooting_counter = 0;
$(".figure1").click(function () { $(".figure1").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian1").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian1").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -200,6 +239,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
}); });
$(".figure2").click(function () { $(".figure2").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian2").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian2").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -210,6 +250,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
}); });
$(".figure3").click(function () { $(".figure3").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian3").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian3").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -220,6 +261,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
}); });
$(".figure4").click(function () { $(".figure4").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian4").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian4").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -229,6 +271,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
reach_counter() reach_counter()
}); });
$(".figure5").click(function () { $(".figure5").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian5").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian5").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -238,6 +281,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
reach_counter() reach_counter()
}); });
$(".figure6").click(function () { $(".figure6").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian6").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian6").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -247,6 +291,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
reach_counter() reach_counter()
}); });
$(".figure7").click(function () { $(".figure7").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian7").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian7").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -256,6 +301,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
reach_counter() reach_counter()
}); });
$(".figure8").click(function () { $(".figure8").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian8").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian8").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -265,6 +311,7 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
reach_counter() reach_counter()
}); });
$(".figure9").click(function () { $(".figure9").click(function () {
explosion.play();
shooting_counter ++; shooting_counter ++;
console.log(shooting_counter); console.log(shooting_counter);
$("#saurian9").attr( "src", "imgs/saurian_headquarter/fire_once2.gif"); $("#saurian9").attr( "src", "imgs/saurian_headquarter/fire_once2.gif");
@ -284,10 +331,13 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
$("#cloud2").animate({ left: "42%"}, { $("#cloud2").animate({ left: "42%"}, {
duration: 500 duration: 500
}).promise().done(function(){ }).promise().done(function(){
appear.play();
$("#thunders").show(); $("#thunders").show();
setTimeout( function() { setTimeout( function() {
$("#amanda").show(); $("#amanda").show();
setTimeout( function() { setTimeout( function() {
click.play();
comic.play();
$(".message1").hide(); $(".message1").hide();
$(".message2,.bubble1").show(); $(".message2,.bubble1").show();
$(".blur").addClass("blur_background"); $(".blur").addClass("blur_background");
@ -299,19 +349,25 @@ document.querySelector('#player_name').innerHTML = localStorage.playerName;
} }
$(".bubble1").click( function() { $(".bubble1").click( function() {
comic.play();
theme.pause();
amanda.play();
$(".bad").hide(); $(".bad").hide();
$(".good").show(); $(".good").show();
$(".stop_invert").removeClass("invert"); $(".stop_invert").removeClass("invert");
$(".bubble1, #thunders").hide(); $(".bubble1, #thunders").hide();
$(".bubble2").toggle(); $(".bubble2").toggle();
setTimeout( function() { setTimeout( function() {
click.play();
$(".message2").hide(); $(".message2").hide();
$(".message3").show(); $(".message3").show();
$(".blur").removeClass("blur_background"); $(".blur").removeClass("blur_background");
smoke.play();
},2500); },2500);
}); });
$(".bubble2").click( function() { $(".bubble2").click( function() {
click.play();
$(".bubble2").toggle(); $(".bubble2").toggle();
$("#amanda, #cloud, #cloud2").hide(); $("#amanda, #cloud, #cloud2").hide();
}) })

BIN
tree/sound/.DS_Store vendored

Binary file not shown.

Binary file not shown.
Loading…
Cancel
Save