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.
276 lines
9.4 KiB
HTML
276 lines
9.4 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>walk</title>
|
||
4 years ago
|
<link rel="icon" href="imgs/park/flower2.gif">
|
||
4 years ago
|
<link rel="stylesheet" href="park_N_clues.css">
|
||
4 years ago
|
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<div id="groundline"></div>
|
||
|
|
||
|
<div id="ground">
|
||
|
<div id="player_img"></div>
|
||
|
<div id="player_img"></div>
|
||
4 years ago
|
<img id="cat" src="imgs/park/cat.gif" height="40px" style="display: none;">
|
||
|
<img id="snake" src="imgs/park/snake.gif" height="40px" style="display: none;">
|
||
4 years ago
|
<img id="bench" src="imgs/park/bench.gif" height="150px">
|
||
|
<img id="tree1" src="imgs/park/tree1.gif" height="200px">
|
||
|
<img id="tree2" src="imgs/park/tree4.gif" height="160px">
|
||
|
<img id="tree3" src="imgs/park/tree4.gif" height="160px">
|
||
4 years ago
|
<img id="tree3_5" src="imgs/park/tree1.gif" height="200px">
|
||
4 years ago
|
<img id="flower1" src="imgs/park/flower1.gif" height="30px">
|
||
|
<img id="flower2" src="imgs/park/flower3.gif" height="40px">
|
||
|
<img id="flower3" src="imgs/park/flower3.1.gif" height="40px">
|
||
|
<img id="flower4" src="imgs/park/flower1.1.gif" height="30px">
|
||
|
<img id="flower5" src="imgs/park/flower1.gif" height="30px">
|
||
|
<img id="grass1" src="imgs/park/grass1.gif" height="90px">
|
||
|
<img id="statue" src="imgs/park/statue.gif" height="150px">
|
||
|
<img id="tree4" src="imgs/park/tree4.gif" height="160px">
|
||
|
<img id="flower6" src="imgs/park/flower1.1.gif" height="30px">
|
||
|
<img id="flower7" src="imgs/park/flower3.1.gif" height="40px">
|
||
|
<img id="flower8" src="imgs/park/flower3.1.gif" height="40px">
|
||
|
<img id="tree5" src="imgs/park/tree1.gif" height="230px">
|
||
|
<img id="sport1" src="imgs/park/fitness1.gif" height="70px">
|
||
|
<img id="sport2" src="imgs/park/fitness2.gif" height="70px">
|
||
4 years ago
|
<img id="newspaper_seller" src="imgs/park/newspaper_seller.gif" height="110px">
|
||
|
<img id="woman" src="imgs/park/woman.gif" height="120px">
|
||
|
<img id="woman2" src="imgs/park/woman2.gif" height="110px">
|
||
4 years ago
|
<img id="flower9" src="imgs/park/flower1.1.gif" height="30px">
|
||
4 years ago
|
<img id="dog" src="imgs/park/dog1.gif" height="80px">
|
||
|
<img id="ned" src="imgs/park/ned2.gif" height="110px">
|
||
4 years ago
|
<img id="grass2" src="imgs/park/grass1.gif" height="90px">
|
||
|
|
||
4 years ago
|
<div class="woman_bubble" style="display: none;">Have you heard about the food poisoning at the school? My son is out for the trip this week-end. I hope everything will be fine.</div>
|
||
|
<div class="woman2_bubble" style="display: none;">I'm so glad my grandchildren are away for the weekend.</div>
|
||
|
<div class="dog_bubble" style="display: none;">I would talk to Ned if I were you.</div>
|
||
|
<div class="vendor_bubble" style="display: none;">Did you read today's news? Crazy stuff is happening in the valley.</div>
|
||
|
<div class="fit2_bubble" style="display: none;">I heard that someone is already investigating.</div>
|
||
|
<div class="fit1_bubble" style="display: none;">The truth will come out, they are keeping an eye on Monteferro.</div>
|
||
|
<div class="ned_bubble1" style="display: none;">Do you wanna hear what I jound found out?</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 investigating the kids' conditions. Believe me, the situation is shadier than it looks.</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 fields: I can show you the proof that what I'm saying is true.</div>
|
||
4 years ago
|
|
||
|
</div>
|
||
|
|
||
|
<div class="text_container">
|
||
|
<div class="message1 instructions">
|
||
4 years ago
|
<span class="instructions_arrow">→</span> Move around the park with the arrows ←↑↓→
|
||
4 years ago
|
</div>
|
||
|
<div class="message2" style="display: none;">
|
||
|
You found him! <button class="ned_more"><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>
|
||
|
</div>
|
||
|
|
||
|
|
||
|
<script src="jquery.min.js"></script>
|
||
|
<script>
|
||
|
|
||
|
// player moves
|
||
|
|
||
|
//adjust camera scroll
|
||
|
var $div = $('#player_img');
|
||
|
var screenLeftMin = 200;
|
||
|
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)
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
4 years ago
|
|
||
4 years ago
|
//move the character
|
||
|
|
||
|
$(document).keydown(function(e) {
|
||
|
var offset = $div.position();
|
||
|
console.log("offset:", offset);
|
||
|
|
||
|
// change z-index
|
||
|
var parent_height = $("#ground").height();
|
||
|
var top_val_px = $div.css('top');
|
||
|
var top_val_only = parseInt(top_val_px);
|
||
|
var top_Percentage = (top_val_only/parent_height) * 100;
|
||
|
console.log ("top %", top_Percentage);
|
||
|
|
||
4 years ago
|
var parent_width = $("#ground").width();
|
||
|
var left_val_px = $div.css('left');
|
||
|
var left_val_only = parseInt(left_val_px);
|
||
|
var left_Percentage = (left_val_only/parent_width) * 100;
|
||
|
console.log ("left %", left_Percentage);
|
||
|
|
||
|
if (left_Percentage > 20) {
|
||
|
$("#snake").show();
|
||
|
$("#snake").animate({ top: "120%" }, {
|
||
|
duration: 2000
|
||
|
}).promise().done(function(){
|
||
|
$("#snake").hide();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
if (left_Percentage > 80) {
|
||
|
$("#cat").show();
|
||
|
$("#cat").animate({ left: "120%" }, {
|
||
|
duration: 2000
|
||
|
}).promise().done(function(){
|
||
|
$("#cat").hide();
|
||
|
});
|
||
|
}
|
||
|
|
||
4 years ago
|
if (top_Percentage > 65) {
|
||
|
$div.css ("zIndex", 5)
|
||
|
}
|
||
|
if (top_Percentage < 55 && top_Percentage > 39) {
|
||
|
$div.css ("zIndex", 4)
|
||
|
}
|
||
|
if (top_Percentage < 39) {
|
||
|
$div.css ("zIndex", 1)
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
switch (e.which) {
|
||
|
case 37:
|
||
|
offset.left -= 20;
|
||
|
console.log("left");
|
||
4 years ago
|
$div.addClass("flipped");
|
||
|
$(".message1").hide();
|
||
4 years ago
|
break;
|
||
|
case 38:
|
||
|
offset.top -= 20;
|
||
|
console.log("top");
|
||
4 years ago
|
$(".message1").hide();
|
||
4 years ago
|
break;
|
||
|
case 39:
|
||
|
offset.left += 20;
|
||
|
console.log("right");
|
||
4 years ago
|
$div.removeClass("flipped");
|
||
|
$(".message1").hide();
|
||
4 years ago
|
break;
|
||
|
case 40:
|
||
|
offset.top += 20;
|
||
|
console.log("down");
|
||
4 years ago
|
$(".message1").hide();
|
||
4 years ago
|
break;
|
||
|
}
|
||
|
//check the offset and prevent the character to exceed the screen dimension
|
||
|
if (offset.left < 80) {
|
||
|
offset.left = 80;
|
||
|
}
|
||
|
if (offset.left > $("#ground").width() - 250) {
|
||
|
offset.left = $("#ground").width() - 250;
|
||
|
|
||
|
}
|
||
|
|
||
|
if (offset.top < 130) {
|
||
|
offset.top = 130;
|
||
|
}
|
||
|
if (offset.top > $("#ground").height() - 250) {
|
||
|
offset.top = $("#ground").height() - 250;
|
||
|
|
||
|
}
|
||
|
|
||
|
$div.css("left", offset.left);
|
||
|
$div.css("top", offset.top);
|
||
|
e.preventDefault();
|
||
|
adjustScroll();
|
||
|
|
||
|
})
|
||
|
|
||
|
/* manipulate the z-index of the character
|
||
|
|
||
|
var offset_percent = offset
|
||
|
|
||
|
if (offset */
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
// 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
|
||
|
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
|
||
|
|
||
|
|
||
|
$("#woman").click (function(){
|
||
|
$(".woman_bubble").toggle();
|
||
|
});
|
||
|
|
||
4 years ago
|
$("#woman2").click (function(){
|
||
|
$(".woman2_bubble").toggle();
|
||
|
});
|
||
|
|
||
4 years ago
|
$("#dog").click (function(){
|
||
|
$(".dog_bubble").toggle();
|
||
|
});
|
||
|
|
||
|
$("#newspaper_seller").click (function(){
|
||
|
$(".vendor_bubble").toggle();
|
||
|
});
|
||
|
|
||
|
$("#sport1").click (function(){
|
||
|
$(".fit2_bubble").toggle();
|
||
|
});
|
||
|
|
||
|
$("#sport2").click (function(){
|
||
|
$(".fit1_bubble").toggle();
|
||
|
});
|
||
|
|
||
|
$("#ned").click (function(){
|
||
4 years ago
|
$(".ned_bubble2").toggle();
|
||
4 years ago
|
$(".message1").hide();
|
||
|
setTimeout (function () {
|
||
4 years ago
|
$(".ned_bubble3").show();
|
||
|
setTimeout (function () {
|
||
|
$(".message3").show();
|
||
|
},2000);
|
||
|
},2000);
|
||
4 years ago
|
});
|
||
4 years ago
|
/*
|
||
4 years ago
|
$(".ned_more").click (function(){
|
||
|
$(".ned_bubble3").toggle();
|
||
|
$(".message2,.ned_bubble1, .ned_bubble2").hide();
|
||
|
setTimeout (function () {
|
||
|
$(".message3").show();
|
||
|
},3000);
|
||
4 years ago
|
});*/
|
||
4 years ago
|
|
||
|
|
||
|
</script>
|
||
|
|
||
|
<script type="text/javascript" src="index.js" ></script>
|
||
|
|
||
|
|
||
|
</body>
|