|
|
|
@ -9,6 +9,16 @@
|
|
|
|
|
|
|
|
|
|
</head>
|
|
|
|
|
<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="ground"class="invert"></div>
|
|
|
|
|
<svg class="invert">
|
|
|
|
|
<line x1="10" y1="130" x2="80%" y2="130" style="stroke:black;stroke-width:1" />
|
|
|
|
@ -88,10 +98,28 @@
|
|
|
|
|
<script src="jquery.min.js"></script>
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
//audio
|
|
|
|
|
|
|
|
|
|
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() {
|
|
|
|
|
theme.play();
|
|
|
|
|
theme.addEventListener('paused',function() {
|
|
|
|
|
theme.play();
|
|
|
|
|
},false);
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
var fluoride = 5;
|
|
|
|
|
|
|
|
|
|
// saves game step in the local storage
|
|
|
|
|
window.onload = function() {
|
|
|
|
|
theme.play();
|
|
|
|
|
window.localStorage.setItem("school_canteen","opened");
|
|
|
|
|
console.log ("school canteen:",localStorage.school_canteen);
|
|
|
|
|
$('.cobs_collected').html(fluoride);
|
|
|
|
@ -108,6 +136,8 @@ var fluoride = 5;
|
|
|
|
|
//change characters + invert
|
|
|
|
|
|
|
|
|
|
$("#table").click (function(){
|
|
|
|
|
theme.pause();
|
|
|
|
|
scary.play();
|
|
|
|
|
$(".cooking, #table, .message1 ").hide();
|
|
|
|
|
$(".satan, #column, .message2").show();
|
|
|
|
|
$(".invert").addClass("invert_style");
|
|
|
|
@ -131,6 +161,7 @@ var fluoride = 5;
|
|
|
|
|
weapon.animate({ left: "30%" }, {
|
|
|
|
|
duration: 300
|
|
|
|
|
}).promise().done(function(){
|
|
|
|
|
shot.play();
|
|
|
|
|
$("#satan1").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
@ -154,11 +185,12 @@ var fluoride = 5;
|
|
|
|
|
weapon.animate({ left: "60%" }, {
|
|
|
|
|
duration: 300
|
|
|
|
|
}).promise().done(function(){
|
|
|
|
|
$("#satan2").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
shot.play();
|
|
|
|
|
$("#satan2").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
hit_ned();
|
|
|
|
@ -177,17 +209,19 @@ var fluoride = 5;
|
|
|
|
|
weapon.animate({ left: "80%" }, {
|
|
|
|
|
duration: 300
|
|
|
|
|
}).promise().done(function(){
|
|
|
|
|
$("#satan3").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
shot.play();
|
|
|
|
|
$("#satan3").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
hit_ned();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$("#satan4").click (function(){
|
|
|
|
|
shot.play();
|
|
|
|
|
--fluoride;
|
|
|
|
|
console.log("fluoride:", fluoride);
|
|
|
|
|
weapon.hide();
|
|
|
|
@ -200,12 +234,13 @@ var fluoride = 5;
|
|
|
|
|
weapon.animate({ left: "46%" }, {
|
|
|
|
|
duration: 300
|
|
|
|
|
}).promise().done(function(){
|
|
|
|
|
$("#satan4").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
});
|
|
|
|
|
shot.play();
|
|
|
|
|
$("#satan4").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
hit_ned();
|
|
|
|
|
});
|
|
|
|
@ -223,11 +258,12 @@ var fluoride = 5;
|
|
|
|
|
weapon.animate({ left: "80%" }, {
|
|
|
|
|
duration: 300
|
|
|
|
|
}).promise().done(function(){
|
|
|
|
|
$("#satan5").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
shot.play();
|
|
|
|
|
$("#satan5").attr("src", "imgs/canteen/fire_once.gif");
|
|
|
|
|
weapon.hide();
|
|
|
|
|
console.log("weapon hide");
|
|
|
|
|
weapon.css({ left: "11%" });
|
|
|
|
|
check_end_game();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
hit_ned();
|
|
|
|
@ -237,6 +273,9 @@ var fluoride = 5;
|
|
|
|
|
function hit_ned() {
|
|
|
|
|
if (fluoride == 2) {
|
|
|
|
|
$("#ned_flame").show();
|
|
|
|
|
setTimeout( function() {
|
|
|
|
|
shot.play();
|
|
|
|
|
}, 200);
|
|
|
|
|
//$("#ned_flame").delay(1000).hide();
|
|
|
|
|
$("#ned").attr("src", "imgs/canteen/ned_wounded.gif");
|
|
|
|
|
}
|
|
|
|
@ -249,6 +288,7 @@ var fluoride = 5;
|
|
|
|
|
if (fluoride == 0) {
|
|
|
|
|
console.log("game over!");
|
|
|
|
|
$(".game_bar").addClass("game_bar_glow");
|
|
|
|
|
click.play();
|
|
|
|
|
setTimeout( function (){
|
|
|
|
|
figures_all.detach();
|
|
|
|
|
$(".game_bar").hide();
|
|
|
|
@ -257,6 +297,8 @@ var fluoride = 5;
|
|
|
|
|
$(".message2").hide();
|
|
|
|
|
$(".message3").show();
|
|
|
|
|
$(".invert").removeClass("invert_style");
|
|
|
|
|
scary.pause();
|
|
|
|
|
theme.play();
|
|
|
|
|
setTimeout (function () {
|
|
|
|
|
$(".game_bar").hide();
|
|
|
|
|
$(".ned_bubble1").show();
|
|
|
|
@ -268,9 +310,11 @@ var fluoride = 5;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
$(".ned_bubble1").click( function(){
|
|
|
|
|
comic.play();
|
|
|
|
|
$(".ned_bubble1").hide();
|
|
|
|
|
$(".ned_bubble2").show();
|
|
|
|
|
setTimeout (function () {
|
|
|
|
|
click.play();
|
|
|
|
|
$(".message3").hide();
|
|
|
|
|
$(".message4").show();
|
|
|
|
|
$("#ned").attr("src", "imgs/canteen/ned_wounded.png");
|
|
|
|
@ -278,6 +322,7 @@ var fluoride = 5;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
$(".ned_bubble2").click( function(){
|
|
|
|
|
click.play();
|
|
|
|
|
$(".ned_bubble2").hide();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|