You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

372 lines
12 KiB
HTML

4 years ago
<!DOCTYPE html>
<html lang="en-US">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>square</title>
<link rel="icon" href="imgs/square_s/house9.gif">
<link rel="stylesheet" href="square_satanism.css">
</head>
<body>
4 years ago
<div class="back" style="display: none;">
Do you want to start from the beginning?<br>
<button id="go_to_start" class="button_back"> yes </button> / <button id="stay"class="button_back"> no </button>
</div>
4 years ago
4 years ago
<audio loop="loop" id="theme2" preload="auto"><source src="sound/theme2.wav" type="audio/wav"></audio>
<audio loop="loop" id="theme3" 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/baloon_intense.wav" type="audio/wav"></audio>
<audio id="anger"><source src="sound/anger.wav" type="audio/wav"></audio>
4 years ago
4 years ago
<div id="ground" class="invert"></div>
<div class="ground_line invert"></div>
4 years ago
<!--game bar-->
4 years ago
<div class="game_bar" >
4 years ago
villagers: <span class="fighters"></span> / 9
</div>
4 years ago
<img id="thunder1" src="imgs/square_s/thunder.gif" height="150px" style="display: none;">
<img id="thunder2" src="imgs/square_s/thunder2.gif" height="200px" style="display: none;">
4 years ago
<!--characters-->
<div id="player_img" class="moving_duo"></div>
4 years ago
<!--<div class="bubble moving_duo" style="display: none;">!!!</div>-->
<div class="bubble moving_duo" style="display: none;">
<img src="imgs/square_s/woman.png" height="30px">
<img src="imgs/square_s/pill.png" height="30px">
<img src="imgs/square_s/child.png" height="30px">
</div>
4 years ago
<div class="figure1 figures">
4 years ago
<img id="person1" class="people" src="imgs/square_s/person1.gif" height="110px">
4 years ago
<img id="fighter1" class="fighters" src="imgs/square_s/fighter1.gif" height="120px" style="display: none;">
</div>
<div class="figure2 figures">
<img id="person2" class="people" src="imgs/square_s/person2.gif" height="100px">
<img id="fighter2" class="fighters" src="imgs/square_s/fighter2.gif" height="120px" style="display: none;">
</div>
<div class="figure3 figures">
<img id="person3" class="people" src="imgs/square_s/person3.gif" height="110px">
<img id="fighter3" class="fighters" src="imgs/square_s/fighter3.gif" height="120px" style="display: none;">
</div>
4 years ago
<div class="figure4 figures to_flip">
4 years ago
<img id="person4" class="people" src="imgs/square_s/person4.gif" height="110px">
<img id="fighter4" class="fighters" src="imgs/square_s/fighter4.gif" height="120px" style="display: none;">
</div>
4 years ago
<div class="figure5 figures to_flip">
4 years ago
<img id="person5" class="people" src="imgs/square_s/person5.gif" height="90px">
<img id="fighter5" class="fighters" src="imgs/square_s/fighter5.gif" height="110px" style="display: none;">
</div>
<div class="figure6 figures">
4 years ago
<img id="person6" class="people" src="imgs/square_s/person6.gif" height="110px">
<img id="fighter6" class="fighters" src="imgs/square_s/fighter6.gif" height="160px" style="display: none;">
4 years ago
</div>
4 years ago
<div class="figure7 figures to_flip">
<img id="person7" class="people" src="imgs/square_s/person7.gif" height="110px">
<img id="fighter7" class="fighters" src="imgs/square_s/fighter7.gif" height="120px" style="display: none;">
4 years ago
</div>
<div class="figure8 figures">
4 years ago
<img id="person8" class="people" src="imgs/square_s/person8.gif" height="110px">
<img id="fighter8" class="fighters" src="imgs/square_s/fighter8.gif" height="120px" style="display: none;">
4 years ago
</div>
<div class="figure9 figures">
4 years ago
<img id="person9" class="people" src="imgs/square_s/person9.gif" height="110px">
<img id="fighter9" class="fighters" src="imgs/square_s/fighter9.gif" height="130px" style="display: none;">
4 years ago
</div>
<!--baloons-->
<!--bottom text-->
4 years ago
<div class="text_container invert">
4 years ago
<div class="message1">
You are in the village square. You must inform the villagers of what is going on in the school: the kids need to be rescued from the evil staff. <br>
4 years ago
<span class="instructions"><span class="instructions_arrow"></span> Click on the villagers to share with them your findings!</span>
4 years ago
</div>
<div class="message2" style="display: none;" >
4 years ago
It looks like you managed to reclute quite an impressive army: <button onclick="location.href='river_bank.html';"><span class="button_text"> guide them to the river bank</span></button> and raise anchor to Spring River.
4 years ago
</div>
</div>
<script src="jquery.min.js"></script>
4 years ago
<script>
//audio
var theme = document.querySelector("#theme2");
var scary = document.querySelector("#theme3");
var click = document.querySelector("#click");
var comic = document.querySelector("#comic");
4 years ago
var anger = document.querySelector("#anger");
anger.volume= 0.3;
click.volume=0.5;
comic.volume=0.5;
scary.volume=0.7;
//go back to start
$(document).keydown(function(e) {
e.preventDefault();
switch (e.which) {
case 83:
$(".back").show();
}
});
$("#go_to_start").click( function (){
window.location.href="index.html";
click.play();
});
$("#stay").click( function (){
$(".back").hide();
click.play();
});
4 years ago
$("body").hover( function() {
if (villagers < 9){
theme.play();
theme.addEventListener('paused',function() {
theme.play();
},false);
}
})
4 years ago
// saves game step in the local storage
window.onload = function() {
4 years ago
4 years ago
theme.play();
window.localStorage.setItem("square_satanism","opened");
console.log ("square satanism:",localStorage.square_satanism);
$(".fighters").html("0");
4 years ago
}
//get player avatar from local storage
console.log (localStorage.myavatar)
var img = document.createElement("img");
img.src = localStorage.myavatar;
var player_img = document.querySelector("#player_img");
player_img.appendChild(img);
//change characters + invert
/* $().click (function(){
});*/
//warriors
var villagers = 0;
var duo = $(".moving_duo");
var avatar = $("#player_img");
var baloon = $(".bubble");
4 years ago
$("#person1").click (function(){
4 years ago
check_flipping();
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
avatar.css({ top: "16%", left: "35%" });
baloon.css({ top: "7%", left: "37%" })
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person1").hide();
$("#fighter1").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person2").click (function(){
4 years ago
check_flipping();
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
avatar.css({ top: "13%", left: "59%" });
baloon.css({ top: "4%", left: "61%" })
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person2").hide();
$("#fighter2").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person3").click (function(){
4 years ago
check_flipping();
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
avatar.css({ top: "22%", left: "77%"});
baloon.css({ top: "13%", left: "80%" })
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person3").hide();
$("#fighter3").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person4").click (function(){
4 years ago
if (avatar.hasClass("flipped") == false) {
avatar.addClass("flipped");
}
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
avatar.css({ top: "50%", left: "62%"});
4 years ago
baloon.css({ top: "41%", left: "64%" })
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person4").hide();
$("#fighter4").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person5").click (function(){
4 years ago
if (avatar.hasClass("flipped") == false) {
avatar.addClass("flipped");
}
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
duo.css ("zIndex", 0);
avatar.addClass("flipped");
avatar.css({ top: "14%", left: "17%" });
baloon.css({ top: "5%", left: "21%" });
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person5").hide();
$("#fighter5").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person6").click (function(){
4 years ago
check_flipping();
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
duo.css ("zIndex", 1);
avatar.css({ top: "53%", left: "29%" });
baloon.css({ top: "43%", left: "31%" });
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person6").hide();
$("#fighter6").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person7").click (function(){
4 years ago
if (avatar.hasClass("flipped") == false) {
avatar.addClass("flipped");
}
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
avatar.addClass("flipped");
avatar.css({ top: "33%", left: "26%" });
baloon.css({ top: "24%", left: "28%" });
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person7").hide();
$("#fighter7").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person8").click (function(){
4 years ago
check_flipping();
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
duo.css ("zIndex", 1);
avatar.css({ top: "43%", left: "72%" });
baloon.css({ top: "35%", left: "75%" });
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person8").hide();
$("#fighter8").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
$("#person9").click (function(){
4 years ago
check_flipping();
4 years ago
villagers ++;
$(".fighters").html(villagers);
4 years ago
avatar.css({ top: "29%", left: "48%" });
baloon.css({ top: "19%", left: "51%" });
4 years ago
baloon.show();
4 years ago
comic.play();
4 years ago
setTimeout ( function (){
$("#person9").hide();
$("#fighter9").show();
baloon.hide();
4 years ago
anger.play();
}, 800);
4 years ago
end_recluting();
});
4 years ago
function end_recluting() {
4 years ago
if (villagers == 9) {
4 years ago
$(".back").css("background-color","black");
4 years ago
setTimeout ( function (){
4 years ago
$(".game_bar").addClass("game_bar_glow");
4 years ago
$(".message1").hide();
4 years ago
$(".message2").show();
click.play();
theme.pause();
scary.play();
4 years ago
$(".invert").addClass("invert_style");
$("#thunder1, #thunder2 ").show();
check_flipping();
avatar.css({ top: "55%", left: "8%" })
}, 1000);
4 years ago
}
}
4 years ago
function check_flipping() {
if (avatar.hasClass("flipped") == true) {
avatar.removeClass("flipped");
}
}
4 years ago
</script>
<script type="text/javascript" src="index.js" ></script>
</body>