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.

167 lines
6.1 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>looking for</title>
<link rel="icon" href="imgs/park/flower2.gif">
<link rel="stylesheet" href="park.css">
</head>
<body>
<div id="groundline"></div>
3 years ago
<div id="ground">
3 years ago
<div id="player_img"></div>
3 years ago
<img id="bench" src="imgs/park/bench1.gif" height="20%">
<img id="tree1" src="imgs/park/tree1.gif" height="30%">
<img id="tree2" src="imgs/park/tree4.gif" height="25%">
<img id="tree3" src="imgs/park/tree4.gif" height="25%">
<img id="newspaperimg" src="imgs/park/newspaper2.gif" height="7%">
<img id="flower1" src="imgs/park/flower1.gif" height="5%">
<img id="flower2" src="imgs/park/flower3.gif" height="7%">
<img id="flower3" src="imgs/park/flower3.1.gif" height="6%">
<img id="flower4" src="imgs/park/flower1.1.gif" height="5%">
<img id="flower5" src="imgs/park/flower1.gif" height="5%">
<img id="grass1" src="imgs/park/grass1.gif" height="75vw">
<img id="grass2" src="imgs/park/grass1.gif" height="75vw">
3 years ago
<img id="statue" src="imgs/park/statue.gif" height="22%">
<img id="tree4" src="imgs/park/tree4.gif" height="25%">
<img id="flower6" src="imgs/park/flower1.1.gif" height="5%">
<img id="flower7" src="imgs/park/flower3.1.gif" height="6%">
<img id="flower8" src="imgs/park/flower3.1.gif" height="6%">
<img id="tree5" src="imgs/park/tree1.gif" height="30%">
<!-- <img id="dog_guy" src="imgs/park/guy_dog.gif" height="13%">-->
<img id="sport1" src="imgs/park/fitness1.gif" height="10%">
<img id="sport2" src="imgs/park/fitness2.gif" height="10%">
<img id="newspaper_seller" src="imgs/park/newspaper_seller.gif" height="15%">
<img id="woman" src="imgs/park/woman.gif" height="19%">
<img id="ned" src="imgs/park/ned.gif" height="15%">
<div class="woman_bubble" style="display: none;">I don't know, you should try to ask the news vendor.</div>
<div class="vendor_bubble" style="display: none;">I sold a copy to a guy not so long ago. He must be still around.</div>
3 years ago
<div class="fit1_bubble" style="display: none;" >...</div>
<div class="fit2_bubble" style="display: none;">...</div>
<div class="ned_bubble1" style="display: none;">I was hoping that someone would find my newspaper</div>
<div class="ned_bubble2" style="display: none;">My name is Ned, I used to be the school's janitor. I got fired last week because the school noticed I was carrying on some investigations on the kid's conditions there. Believe me, the situation is shadier than it seems. Do you wanna know what I just found out?</div>
<div class="ned_bubble3" style="display: none;">The school is involved in sinister activities: together with the Monteferro Food Enterprise they are poisoning the children's meals. Follow me to the enterprise's headquarter: I can show you the proof of what I'm saying</div>
3 years ago
</div>
3 years ago
<div class="text_container">
3 years ago
<div class="message1 instructions">
3 years ago
Move around the park with the arrows ←↑↓→ and click on the people to ask them if they saw the owner of the newspaper.
3 years ago
</div>
3 years ago
<div class="message2" style="display: none;">
You found him! <button class="ned1"><span class="button_text">Hear more from Ned</span></button> .
</div>
<div class="message3" style="display: none;">
It looks intriguing: <button onclick="location.href='monteferro.html';"><span class="button_text">go to the Monteferro Food Enterprise</span></button> with Ned.
</div>
3 years ago
</div>
<script src="jquery.min.js"></script>
<script>
3 years ago
// player moves
3 years ago
var $div = $('#player_img');
3 years ago
var screenLeftMin = 200;
3 years ago
var screenLeftMax = 870;
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)
}
}
3 years ago
3 years ago
$(document).keydown(function(e) {
switch (e.which) {
case 37:
3 years ago
$div.css('left', $div.offset().left - 20);
3 years ago
e.preventDefault();
adjustScroll();
3 years ago
break;
case 38:
3 years ago
$div.css('top', $div.offset().top - 20);
3 years ago
e.preventDefault();
adjustScroll();
3 years ago
break;
case 39:
3 years ago
$div.css('left', $div.offset().left + 20);
3 years ago
e.preventDefault();
adjustScroll();
3 years ago
break;
case 40:
3 years ago
$div.css('top', $div.offset().top + 20);
3 years ago
e.preventDefault();
adjustScroll();
3 years ago
break;
}
})
3 years ago
// saves game step in the local storage
window.onload = function() {
window.localStorage.setItem("looking_for_N","opened")
console.log ("looking for N:",localStorage.looking_for_N)
}
//get player avatar from local storage
3 years ago
console.log (localStorage.myavatar)
var img = document.createElement("img");
img.src = localStorage.myavatar;
var player_img = document.querySelector("#player_img");
player_img.appendChild(img);
//get player name from local storage
3 years ago
$("#woman").click (function(){
$(".woman_bubble").toggle();
});
$("#newspaper_seller").click (function(){
$(".vendor_bubble").toggle();
});
3 years ago
3 years ago
$("#sport1").click (function(){
$(".fit2_bubble").toggle();
});
$("#sport2").click (function(){
$(".fit1_bubble").toggle();
});
$("#ned").click (function(){
$(".ned_bubble1, .ned_bubble2").toggle();
$(".message1").hide();
$(".message2").show();
});
$(".ned1").click (function(){
$(".message2").hide();
$(".ned_bubble3,.message3 ").show();
});
3 years ago
</script>
3 years ago
3 years ago
<script type="text/javascript" src="index.js" ></script>
3 years ago
3 years ago
</body>