master
*anna* 3 years ago
parent 9dcea187db
commit f71c7b828f

@ -130,7 +130,7 @@ span.button_text{
#pill{
bottom: 30%;
left: 8%;
left: 12%;
position:absolute ;
}

@ -8,7 +8,7 @@
<link rel="stylesheet" href="canteen.css">
</head>
<body >
<body>
<div id="ground"class="invert"></div>
<svg class="invert">
@ -19,8 +19,8 @@
<!--characters-->
<div id="player_img"></div>
<img id="pill" src="imgs/canteen/pill.png" height="30px" style="display: none;">
<div class ="moving_duo" id="player_img"></div>
<img class ="moving_duo" id="pill" src="imgs/canteen/pill.png" height="40px"style="display: none;" >
<img id="ned" src="imgs/canteen/ned1.gif" height="120px">
@ -46,7 +46,7 @@
</div>
<div class="figure5">
<img id="cooking5" class="cooking" src="imgs/canteen/woman_cooking_5.gif" height="140px">
<img id="satan4" class="satan" src="imgs/canteen/woman_rites_5.gif" height="160px" style="display: none;">
<img id="satan5" class="satan" src="imgs/canteen/woman_rites_5.gif" height="160px" style="display: none;">
</div>
@ -85,7 +85,8 @@
<script src="jquery.min.js"></script>
<script>
var fluoride = 5;
var fluoride = 5;
// saves game step in the local storage
window.onload = function() {
@ -111,15 +112,97 @@
});
//fight
var duo = $(".moving_duo");
var avatar = $("#player_img");
var weapon = $("#pill");
$(".figure1").click (function(){
avatar.animate({top:'16%'}, "slow");
weapon.animate({top:'16%'}, "slow");
weapon.show();
fluoride -- ;
});
$(".figure1").click (function(){
--fluoride;
console.log(fluoride);
weapon.hide();
duo.animate({top:'18%'}, 500, function() {
weapon.delay(100).show().animate({ left: "30%" }, 150,function(){
$("#satan1").attr("src", "imgs/canteen/fire_once.gif");
//$("#satan1").detach().delay(500);
weapon.hide();
weapon.animate({ left: "11%" });
});
});
$('.cobs_collected').html(fluoride);
setTimeout(stop_game(), 3000);
});
$(".figure2").click (function(){
--fluoride;
console.log(fluoride);
weapon.hide();
duo.animate({top:'12%' }, 500, function() {
weapon.delay(100).show().animate({ left: "60%" }, 150,function(){
$("#satan2").attr("src", "imgs/canteen/fire_once.gif");
weapon.hide();
weapon.animate({ left: "11%" });
});
});
$('.cobs_collected').html(fluoride);
setTimeout(stop_game(), 3000);
});
$(".figure3").click (function(){
--fluoride;
console.log(fluoride);
duo.animate({top:'22%'}, 500, function() {
weapon.delay(100).show().animate({ left: "80%" }, 150,function(){
$("#satan3").attr("src", "imgs/canteen/fire_once.gif");
weapon.hide();
weapon.animate({ left: "11%" });
});
});
$('.cobs_collected').html(fluoride);
setTimeout(stop_game(), 3000);
});
$(".figure4").click (function(){
--fluoride;
console.log(fluoride);
duo.animate({top:'50%'}, 500, function() {
weapon.delay(100).show().animate({ left: "46%" }, 150,function(){
$("#satan4").attr("src", "imgs/canteen/fire_once.gif");
weapon.hide();
weapon.animate({ left: "11%" });
});
});
$('.cobs_collected').html(fluoride);
setTimeout(stop_game(), 3000);
});
$(".figure5").click (function(){
--fluoride;
console.log(fluoride);
duo.animate({top:'40%'}, 500, function() {
weapon.delay(100).show().animate({ left: "80%" }, 150,function(){
$("#satan5").attr("src", "imgs/canteen/fire_once.gif");
weapon.hide();
weapon.animate({ left: "11%" });
});
});
$('.cobs_collected').html(fluoride);
setTimeout(stop_game(), 3000);
});
var figures_all = $(".figure1, .figure2, .figure3, .figure4, .figure5");
function stop_game() {
if (fluoride == 0) {
figures_all.detach();
console.log("hei");
};
};
</script>

Binary file not shown.
Loading…
Cancel
Save