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.

299 lines
9.8 KiB
HTML

3 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_saurians.css">
</head>
<body>
<div id="ground" class="invert"></div>
<div class="ground_line invert"></div>
<!--houses-->
<!--game bar-->
3 years ago
<div class="game_bar" >
3 years ago
villagers: <span class="fighters"></span> / 9
</div>
<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;">
<!--characters-->
<div id="player_img" class="moving_duo"></div>
<div class="bubble moving_duo" style="display: none;">
<img src="imgs/square_saurians/rept.png" height="30px"> !
<img src="imgs/square_saurians/meat.png" height="30px"> =
<img src="imgs/square_saurians/cat.png" height="30px">
</div>
<div class="figure1 figures">
<img id="person1" class="people" src="imgs/square_saurians/person1.gif" height="110px">
<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_saurians/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_saurians/person3.gif" height="110px">
<img id="fighter3" class="fighters" src="imgs/square_s/fighter3.gif" height="120px" style="display: none;">
</div>
<div class="figure4 figures to_flip">
<img id="person4" class="people" src="imgs/square_saurians/person4.gif" height="110px">
<img id="fighter4" class="fighters" src="imgs/square_s/fighter4.gif" height="120px" style="display: none;">
</div>
<div class="figure5 figures to_flip">
<img id="person5" class="people" src="imgs/square_saurians/person5.gif" height="110px">
<img id="fighter5" class="fighters" src="imgs/square_s/fighter5.gif" height="110px" style="display: none;">
</div>
<div class="figure6 figures">
<img id="person6" class="people" src="imgs/square_saurians/person6.gif" height="110px">
<img id="fighter6" class="fighters" src="imgs/square_s/fighter6.gif" height="160px" style="display: none;">
</div>
<div class="figure7 figures to_flip">
<img id="person7" class="people" src="imgs/square_saurians/person7.gif" height="110px">
<img id="fighter7" class="fighters" src="imgs/square_s/fighter7.gif" height="120px" style="display: none;">
</div>
<div class="figure8 figures">
<img id="person8" class="people" src="imgs/square_saurians/person8.gif" height="110px">
<img id="fighter8" class="fighters" src="imgs/square_s/fighter8.gif" height="120px" style="display: none;">
</div>
<div class="figure9 figures">
<img id="person9" class="people" src="imgs/square_saurians/person9.gif" height="110px">
<img id="fighter9" class="fighters" src="imgs/square_s/fighter9.gif" height="130px" style="display: none;">
</div>
<!--baloons-->
<!--bottom text-->
<div class="text_container invert">
<div class="message1">
You are in the village square. Luckily there is an animal rights protest going on. <br>
<span class="instructions"><span class="instructions_arrow"></span> Click on the activists to tell them about the kitten slaughter and the saurian invasion!</span>
</div>
<div class="message2" style="display: none;" >
It looks like you managed to reclute quite an impressive army: <button onclick="location.href='bus_station.html';"><span class="button_text"> guide them to the bus station</span></button> to find the entrance of the saurian headquarter. You need to rescue the kittens!
</div>
</div>
<script src="jquery.min.js"></script>
<script>
// saves game step in the local storage
window.onload = function() {
window.localStorage.setItem("square_satanism","opened");
console.log ("square satanism:",localStorage.square_satanism);
$(".fighters").html("0");
}
//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");
$("#person1").click (function(){
check_flipping();
villagers ++;
$(".fighters").html(villagers);
avatar.css({ top: "16%", left: "35%" });
3 years ago
baloon.css({ top: "5%", left: "34%" })
3 years ago
baloon.show();
setTimeout ( function (){
$("#person1").hide();
$("#fighter1").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person2").click (function(){
check_flipping();
villagers ++;
$(".fighters").html(villagers);
avatar.css({ top: "13%", left: "59%" });
3 years ago
baloon.css({ top: "2%", left: "61%" })
3 years ago
baloon.show();
setTimeout ( function (){
$("#person2").hide();
$("#fighter2").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person3").click (function(){
3 years ago
if (avatar.hasClass("flipped") == false) {
avatar.addClass("flipped");
}
duo.css ("zIndex", 5);
3 years ago
villagers ++;
$(".fighters").html(villagers);
3 years ago
avatar.css({ top: "32%", left: "85%"});
baloon.css({ top: "22%", left: "78%" })
3 years ago
baloon.show();
setTimeout ( function (){
$("#person3").hide();
$("#fighter3").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person4").click (function(){
if (avatar.hasClass("flipped") == false) {
avatar.addClass("flipped");
}
villagers ++;
$(".fighters").html(villagers);
avatar.css({ top: "50%", left: "62%"});
3 years ago
baloon.css({ top: "38%", left: "62%" })
3 years ago
baloon.show();
setTimeout ( function (){
$("#person4").hide();
$("#fighter4").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person5").click (function(){
if (avatar.hasClass("flipped") == false) {
avatar.addClass("flipped");
}
villagers ++;
$(".fighters").html(villagers);
duo.css ("zIndex", 0);
avatar.addClass("flipped");
avatar.css({ top: "14%", left: "17%" });
3 years ago
baloon.css({ top: "2%", left: "17%" });
3 years ago
baloon.show();
setTimeout ( function (){
$("#person5").hide();
$("#fighter5").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person6").click (function(){
check_flipping();
villagers ++;
$(".fighters").html(villagers);
duo.css ("zIndex", 1);
avatar.css({ top: "53%", left: "29%" });
3 years ago
baloon.css({ top: "40%", left: "29%" });
3 years ago
baloon.show();
setTimeout ( function (){
$("#person6").hide();
$("#fighter6").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person7").click (function(){
3 years ago
check_flipping();
3 years ago
villagers ++;
$(".fighters").html(villagers);
avatar.css ("zIndex", -1);
3 years ago
avatar.css({ top: "50%", left: "20%" });
baloon.css({ top: "38%", left: "20%" });
3 years ago
baloon.show();
setTimeout ( function (){
$("#person7").hide();
$("#fighter7").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person8").click (function(){
check_flipping();
villagers ++;
$(".fighters").html(villagers);
duo.css ("zIndex", 1);
avatar.css({ top: "43%", left: "72%" });
3 years ago
baloon.css({ top: "32%", left: "72%" });
3 years ago
baloon.show();
setTimeout ( function (){
$("#person8").hide();
$("#fighter8").show();
baloon.hide();
}, 600);
end_recluting();
});
$("#person9").click (function(){
check_flipping();
villagers ++;
$(".fighters").html(villagers);
3 years ago
avatar.css({top: "29%", left: "48%"});
baloon.css({top: "17%", left: "48%"});
3 years ago
baloon.show();
setTimeout ( function (){
$("#person9").hide();
$("#fighter9").show();
baloon.hide();
}, 600);
end_recluting();
});
function end_recluting() {
if (villagers == 9) {
setTimeout ( function (){
3 years ago
$(".game_bar").addClass("game_bar_glow");
3 years ago
$(".message1").hide();
3 years ago
$(".message2").show();
3 years ago
$(".invert").addClass("invert_style");
$("#thunder1, #thunder2 ").show();
check_flipping();
avatar.css({ top: "55%", left: "8%" })
}, 1000);
}
}
function check_flipping() {
if (avatar.hasClass("flipped") == true) {
avatar.removeClass("flipped");
}
}
</script>
<script type="text/javascript" src="index.js" ></script>
</body>