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.

211 lines
7.3 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" />
4 years ago
<title>follow Pat</title>
<link rel="icon" href="imgs/major_house/house1.gif">
4 years ago
<link rel="stylesheet" href="major_house.css">
</head>
<body >
4 years ago
<div id="ground_color" class="to_invert"></div>
4 years ago
4 years ago
<div id="groundline" class="to_invert"></div>
<div class="duo">
<span id="player_img"></span>
<img id="pat" src="imgs/cat_shelter/parrot.gif" height="100px">
</div>
4 years ago
4 years ago
<div id="ground" >
4 years ago
4 years ago
<img id="fur1" src="imgs/major_house/ball.gif" height="60px">
<img id="fur2" src="imgs/major_house/ball.gif" height="60px">
<img id="fur3" src="imgs/major_house/ball.gif" height="60px">
<img id="fur4" src="imgs/major_house/ball.gif" height="60px">
<img id="fur5" src="imgs/major_house/ball.gif" height="60px">
4 years ago
4 years ago
<img id="tree1" src="imgs/park/tree4.gif" height="160px">
<img id="tree2" src="imgs/park/tree4.gif" height="160px">
<img id="tree3" src="imgs/park/tree4.gif" height="160px">
<img id="tree4" src="imgs/park/tree4.gif" height="160px">
<img id="tree5" src="imgs/park/tree4.gif" height="160px">
<img id="tree6" src="imgs/park/tree4.gif" height="130px">
<img id="tree7" src="imgs/park/tree4.gif" height="130px">
4 years ago
4 years ago
<div class="house">
<img class="good" src="imgs/major_house/house1.gif" height="160px">
<img class="bad" src="imgs/major_house/volcano.gif" height="140px"style="display: none;">
</div>
<div class="figure1">
<img id="person1" class="good" src="imgs/major_house/person1.gif" height="110px">
<img id="rept1" class="bad" src="imgs/major_house/rept1.gif" height="120px" style="display: none;">
</div>
<div class="figure2">
<img id="person2" class="good" src="imgs/major_house/person2.gif" height="80px">
<img id="rept2" class="bad" src="imgs/major_house/rept2.gif" height="120px" style="display: none;">
</div>
<div class="figure3">
<img id="person3" class="good" src="imgs/major_house/person3.gif" height="110px">
<img id="rept3" class="bad" src="imgs/major_house/rept3.gif" height="120px" style="display: none;">
</div>
<div class="figure4">
<img id="person4" class="good" src="imgs/major_house/person4.gif" height="100px">
<img id="rept4" class="bad" src="imgs/major_house/rept4.gif" height="120px" style="display: none;">
</div>
<div class="figure5">
<img id="person5" class="good" src="imgs/major_house/person5.gif" height="120px">
<img id="rept5" class="bad" src="imgs/major_house/rept5.gif" height="120px" style="display: none;">
</div>
<div class="figure6">
<img id="person6" class="good" src="imgs/major_house/person6.gif" height="120px">
<img id="rept6" class="bad" src="imgs/major_house/rept6.gif" height="150px" style="display: none;">
</div>
<div class="figure7">
<img id="cat" class="good" src="imgs/major_house/cat.gif" height="60px">
<img id="barbecue" class="bad" src="imgs/major_house/barbecue4.gif" height="100px" style="display: none;">
</div>
4 years ago
4 years ago
<div class="bubble1 to_invert" style="display: none;">
The Major and his family are actually saurian settlers who came here to invade planet earth.
Use my magnifying glass to see them in their real appearance.
</div>
<div class="bubble2 to_invert" style="display: none;">
They are harvesting the cats to be ready for the arrival of other groups of invaders.
4 years ago
Follow me to the butcher shop, I can show you the proof of what I'm saying.
4 years ago
</div>
4 years ago
4 years ago
<button class="glasses_bar" style="display: none;"> ✜ magnifying glass </button>
<div class="text_container to_invert " >
4 years ago
<div class="message1">
4 years ago
<span class="instructions"><span class="instructions_arrow"></span> Follow the hairballs </span>
</div>
4 years ago
<div class="message2" style="display: none;">
4 years ago
Pat was right, you reached the major's mansion.
4 years ago
</div>
<div class="message3" style="display: none;">
4 years ago
Pat was right from the beginning! I hope Amanda did not get hurt: she can be anywhere by now. <br>
4 years ago
It seems there is no option but to <button onclick="location.href='butchery.html';"><span class="button_text">go to the butcher shop</span></button> .
4 years ago
</div>
</div>
<script src="jquery.min.js"></script>
<script>
// saves game step in the local storage
window.onload = function() {
4 years ago
window.localStorage.setItem("major_house","opened");
console.log ("major house:",localStorage.major_house);
/*
setTimeout( function() {
$('.bubble1').show();
setTimeout( function() {
$('.bubble2').show();
setTimeout( function() {
$('.message1').hide();
$('.message2').show();
}, 2000);
}, 2000);
}, 1000);
*/
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);
//adjust camera scroll
var $div = $('.duo');
var screenLeftMin = 50;
4 years ago
var screenLeftMax = 170;
4 years ago
function adjustScroll() {
var playerLeft = parseInt($div.css("left"));
var scrollLeft = $(document).scrollLeft();
var screenLeft = playerLeft - scrollLeft;
console.log ("screenleft:", screenLeft);
if (screenLeft > screenLeftMax ) {
$(document).scrollLeft(playerLeft - screenLeftMax)
}
if (screenLeft < screenLeftMin ) {
$(document).scrollLeft(playerLeft - screenLeftMin)
}
}
//move the character
$(document).keydown(function(e) {
var offset = $div.position();
console.log("offset:", offset);
switch (e.which) {
case 37:
offset.left -= 20;
console.log("left");
$div.addClass("flipped");
break;
case 39:
offset.left += 20;
console.log("right");
$div.removeClass("flipped");
break;
}
4 years ago
//check the offset and prevent the character from exceeding screen dimension
4 years ago
if (offset.left < 80) {
offset.left = 80;
}
4 years ago
if (offset.left > $("#ground").width() - 1000) {
offset.left = $("#ground").width() - 1000;
$(document).scrollLeft(3500);
4 years ago
$(".message1").hide();
$(".message2").show();
4 years ago
setTimeout( function() {
$('.bubble1').show();
setTimeout( function() {
$('.glasses_bar').show();
4 years ago
$('.glasses_bar').addClass("glass_appear");
4 years ago
}, 3000);
}, 2000);
4 years ago
}
$div.css("left", offset.left);
$div.css("top", offset.top);
e.preventDefault();
adjustScroll();
})
4 years ago
$('.glasses_bar').click ( function(){
$('.to_invert').toggleClass("invert");
$('.glasses_bar').toggleClass("glasses_bar_black");
$('.good').toggle();
$('.bad').toggle();
$('.bubble1, .message2').hide();
$('.bubble2, .message3').show();
$("body").css("overflow", "hidden");
})
4 years ago
</script>
<script type="text/javascript" src="index.js" ></script>
</body>