master
*anna* 4 years ago
parent 9d453a223c
commit fd0efef39d

BIN
.DS_Store vendored

Binary file not shown.

BIN
tree/.DS_Store vendored

Binary file not shown.

@ -0,0 +1,439 @@
@font-face {
font-family: sinistre;
src: url(fonts/Sinistre-SCaroline.woff),
url(fonts/Sinistre-SCaroline.otf);
}
@font-face {
font-family: jolybolditalic;
src: url(fonts/JolyDisplay-BoldDisplayItalic.woff),
url(fonts/JolyDisplay-BoldDisplayItalic.otf);
}
@font-face {
font-family: jolyregular;
src: url(fonts/JolyDisplay-RegularDisplay.woff),
url(fonts/JolyDisplay-RegularDisplay.otf);
}
@font-face {
font-family: jolyregularitalic;
src: url(fonts/JolyDisplay-RegularDisplayItalic.woff),
url(fonts/JolyDisplay-RegularDisplayItalic.otf);
}
body {
font-family: jolyregular;
font-size: 1.8vw;
overflow: hidden;
}
.instructions{
font-family:jolyregularitalic;
}
span.instructions_arrow{
padding-left:40px;
font-size: 2.4vw;
font-family:jolybolditalic;
}
::-moz-selection { /* Code for Firefox */
background: transparent;
}
::selection {
background: transparent;
}
div#player_img {
bottom: 25%;
left: 18%;
position:absolute ;
z-index: 20;
}
#groundline {
position: fixed;
top:130px;
height:0%;
width: 100%;
border-top: 1px solid;
}
div.text_container {
bottom: 40px;
left:40px;
right:40px;
position:absolute;
margin: auto;
line-height: 1.3em;
}
button{
-webkit-appearance: none;
background-color: white;
border: 0.1em black solid;
border-radius: 25em;
color:black;
cursor:pointer;
font-family: jolybolditalic;
}
button:hover{
border: 0.1em transparent solid;
-webkit-box-shadow: 0px 0px 8px 1px black;
-moz-box-shadow: 0px 0px 8px 1px black;
box-shadow: 0px 0px 8px 1px black;
}
span.button_text{
font-size: 1.6vw;
padding: 8px;
}
#player_name{
font-family: jolybolditalic;
}
/*images*/
#tree1 {
top:8%;
left: 40%;
position: absolute;
}
#lizard {
top:140px;
left: 35%;
position: absolute;
z-index:-1;
}
#tree2 {
bottom:40%;
left: 10%;
position: absolute;
z-index:16;
}
#tree3 {
bottom:24%;
right: 11%;
position: absolute;
z-index:10;
}
#grass1{
bottom: 19%;
left: 66%;
position: absolute;
z-index:17;
}
#grass2{
bottom: 70%;
left: 60%;
position: absolute;
}
#house1{
bottom:25%;
left: 35%;
position: absolute;
cursor: pointer;
}
#house2{
top:25%;
left: 75%;
position: absolute;
cursor: pointer;
}
#snake{
top:29%;
left: 76%;
position: absolute;
cursor: pointer;
z-index:-1;
}
#house3{
top: 52%;
left: 55%;
position: absolute;
cursor: pointer;
z-index: 1;
}
#dog{
top: 52%;
left: 55%;
position: absolute;
cursor: pointer;
z-index: 0;
}
#house4{
top: 20%;
left: 10%;
position: absolute;
cursor: pointer;
}
#house5{
top: 30%;
left: 50%;
position: absolute;
cursor: pointer;
}
#house6{
top: 30%;
left: 30%;
position: absolute;
cursor: pointer;
}
#fence1{
top: 60%;
left: 70%;
position: absolute;
}
#fence2{
top: 10%;
left: 80%;
position: absolute;
}
#toy{
top: 43%;
left: 35%;
position: absolute;
}
#fly1{
top: 40%;
left: 69%;
position: absolute;
z-index:20;
}
#fly2{
top: 10%;
left: 25%;
position: absolute;
z-index:20;
}
#pat {
bottom:45%;
left: 45%;
position: absolute;
}
/* bubbles*/
.bubble1 {
bottom: 64%;
left: 33%;
position: absolute;
background: #ffffff;
color: #000000;
font-family: sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 120px;
height: 55px;
border-radius: 10px;
padding: 18px;
border: 1px black solid;
z-index: 10;
}
.bubble1:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-width: 0 30px 24px 0;
border-color: transparent #ffffff transparent transparent;
bottom: -24px;
left: 83%;
margin-left: -15px;
}
.bubble1:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-width: 0 31px 25px 0;
border-color: transparent #000000 transparent transparent;
bottom: -26px;
left: 83%;
margin-left: -15px;
display: block;
}
.bubble2 {
bottom: 64%;
left: 50%;
position: absolute;
background: #ffffff;
color: #000000;
font-family:sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 160px;
height: 35px;
border-radius: 10px;
padding: 18px;
border: #000000 solid 1px;
z-index: 10;
cursor:pointer;
}
.bubble2:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 2;
border-style: solid;
border-width: 24px 30px 0 0;
border-color: #ffffff transparent transparent transparent;
bottom: -24px;
left: 17%;
margin-left: -15px;
}
.bubble2:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-width: 25px 31px 0 0;
border-color: #000000 transparent transparent transparent;
bottom: -26px;
left: 17%;
margin-left: -16px;
display: block;
}
.bubble3 {
bottom: 65%;
left: 30%;
position: absolute;
background: #ffffff;
color: #000000;
font-family: sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 190px;
height: 120px;
border-radius: 10px;
padding: 18px;
border: 1px black solid;
z-index: 10;
}
.bubble3:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-width: 0 30px 24px 0;
border-color: transparent #ffffff transparent transparent;
bottom: -24px;
left: 83%;
margin-left: -15px;
}
.bubble3:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-width: 0 31px 25px 0;
border-color: transparent #000000 transparent transparent;
bottom: -26px;
left: 83%;
margin-left: -15px;
display: block;
}
.bubble4 {
bottom: 64%;
left: 50%;
position: absolute;
background: #ffffff;
color: #000000;
font-family:sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 160px;
height: 35px;
border-radius: 10px;
padding: 18px;
border: #000000 solid 1px;
z-index: 10;
}
.bubble4:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 2;
border-style: solid;
border-width: 24px 30px 0 0;
border-color: #ffffff transparent transparent transparent;
bottom: -24px;
left: 17%;
margin-left: -15px;
}
.bubble4:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-width: 25px 31px 0 0;
border-color: #000000 transparent transparent transparent;
bottom: -26px;
left: 17%;
margin-left: -16px;
display: block;
}
@keyframes touch {
0% {transform: rotate(0deg);}
50% {transform: rotate(-10deg);}
100% {transform: rotate(0deg);}
}
.touch_animation{
animation-name: touch;
animation-duration: 0.2s;
}
/* hide scroll bar */
/* width */
::-webkit-scrollbar {
color:white;
}
/* Track */
::-webkit-scrollbar-track {
background: white;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: white;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: white;
}

@ -0,0 +1,182 @@
<!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>cat shelter</title>
<link rel="icon" href="imgs/cat_shelter/kennel5.png">
<link rel="stylesheet" href="cat_shelter.css">
</head>
<body>
<div id="groundline"></div>
<div id="ground">
<div id="player_img"></div>
<img id="tree1" src="imgs/cat_shelter/tree.gif" height="140px">
<img id="tree2" src="imgs/cat_shelter/tree.gif" height="140px">
<img id="tree3" src="imgs/cat_shelter/tree.gif" height="140px">
<img id="grass1" src="imgs/park/grass1.gif" height="80px">
<img id="grass2" src="imgs/park/grass1.gif" height="70px">
<img id="house1" src="imgs/cat_shelter/kennel1.png" height="90px">
<img id="house2" src="imgs/cat_shelter/kennel2.gif" height="100px">
<img id="house3" src="imgs/cat_shelter/kennel3.png" height="130px">
<img id="house4" src="imgs/cat_shelter/kennel4.png" height="90px">
<img id="house5" src="imgs/cat_shelter/kennel5.png" height="80px">
<img id="house6" src="imgs/cat_shelter/kennel6.png" height="100px">
<!--<img id="shed1" src="imgs/cat_shelter/shed.gif" height="120px">
<img id="fence1" src="imgs/cat_shelter/fence1.gif" height="130px">
<img id="fence2" src="imgs/cat_shelter/fence2.gif" height="100px">-->
<img id="toy" src="imgs/cat_shelter/toy.gif" height="100px">
<img id="fly1" src="imgs/cat_shelter/butterfly.gif" height="40px">
<img id="fly2" src="imgs/cat_shelter/butterfly.gif" height="40px">
<img id="snake" src="imgs/cat_shelter/snake.gif" height="40px" style="display: none;">
<img id="lizard" src="imgs/cat_shelter/lizard.gif" height="25px"style="display: none;">
<img id="dog" src="imgs/cat_shelter/dog2.gif" height="50px"style="display: none;">
<img id="pat" src="imgs/cat_shelter/parrot.gif" height="100px"style="display: none;">
<div class="comic_div">
<div class="bubble1"style="display: none;">Hello stranger, are you looking for something? </div>
<div class="bubble2"style="display: none;"> My name is Pat, nice to meet you. [...] </div>
<div class="bubble3"style="display: none;"> I don't know any Amanda. But believe me, I wouldn't be surprised if something happened to her as well. Like those poor cats. They didn't escape, someone kidnapped them. </div>
<div class="bubble4"style="display: none;"> Follow me, I can tell you more about it.</div>
</div>
</div>
<div class="text_container">
<div class="message1">
You are at the cat shelter: it looks so empty. What could have happened here?<br>
<span class="instructions_arrow"></span><span class="instructions"> Look closer to see if there are any tracks of Amanda</span>
</div>
<div class="message2" style="display:none;">
<span class="instructions_arrow"></span><span class="instructions"> Ask Pat if she has seen Amanda</span>
</div>
<div class="message3" style="display:none;">
I hope Amanda did not get involved in this. <button onclick="location.href='major_house.html';"><span class="button_text">Follow Pat</span></button> to hear more about it.
</div>
</div>
</div>
<script src="jquery.min.js"></script>
<script>
//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);
//store that you've been in the park
window.onload = function() {
window.localStorage.setItem("cat_shelter","opened")
console.log ("cat shelter:",localStorage.cat_shelter)
}
// look in the houses game
var house_counter = 0;
$("#house1").click(function(){
$("#house1").addClass("touch_animation");
house_counter ++;
console.log(house_counter);
pat_appear()
});
$("#house2").click(function(){
$("#house2").addClass("touch_animation");
house_counter ++;
console.log(house_counter);
$("#snake").show();
$("#snake").animate({ left: "120%", top:"120%"}, {
duration: 3000
}).promise().done(function(){
$("#snake").hide();
});
pat_appear()
});
$("#house3").click(function(){
$("#house3").addClass("touch_animation");
house_counter ++;
console.log(house_counter);
$("#dog").show();
$("#dog").animate({ left: "-20%"}, {
duration: 1000
}).promise().done(function(){
$("#dog").hide();
});
pat_appear()
});
$("#house4").click(function(){
$("#house4").addClass("touch_animation");
house_counter ++;
console.log(house_counter);
pat_appear()
});
$("#house5").click(function(){
$("#house5").addClass("touch_animation");
house_counter ++;
console.log(house_counter);
pat_appear()
});
$("#house6").click(function(){
$("#house6").addClass("touch_animation");
house_counter ++;
console.log(house_counter);
$("#lizard").show();
$("#lizard").animate({ left: "-20%"}, {
duration: 5000
}).promise().done(function(){
$("#lizard").hide();
});
pat_appear()
});
function pat_appear(){
if (house_counter == 6){
setTimeout(function(){
console.log("hei");
$("#pat").show();
setTimeout(function(){
$(".bubble1").show();
setTimeout(function(){
$(".bubble2").show();
setTimeout(function(){
$(".message1").hide();
$(".message2").show();
}, 1000);
}, 1500);
}, 1000);
}, 1000);
}
}
$(".bubble2").click(function(){
$(".message2, .bubble1, .bubble2").hide();
$(".bubble3").show();
setTimeout(function(){
$(".bubble4").show();
setTimeout(function(){
$(".message3").show();
}, 1000);
}, 1000);
});
</script>
<script type="text/javascript" src="index.js" ></script>
</body>

BIN
tree/imgs/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 KiB

@ -0,0 +1,362 @@
@font-face {
font-family: sinistre;
src: url(fonts/Sinistre-SCaroline.woff),
url(fonts/Sinistre-SCaroline.otf);
}
@font-face {
font-family: jolybolditalic;
src: url(fonts/JolyDisplay-BoldDisplayItalic.woff),
url(fonts/JolyDisplay-BoldDisplayItalic.otf);
}
@font-face {
font-family: jolyregularitalic;
src: url(fonts/JolyDisplay-RegularDisplayItalic.woff),
url(fonts/JolyDisplay-RegularDisplayItalic.otf);
}
@font-face {
font-family: jolyregular;
src: url(fonts/JolyDisplay-RegularDisplay.woff),
url(fonts/JolyDisplay-RegularDisplay.otf);
}
@font-face {
font-family: jolybold;
src: url(fonts/JolyDisplay-BoldDisplay.woff),
url(fonts/JolyDisplay-BoldDisplay.otf);
}
.invert{
filter: invert(100%);
}
body {
font-family: jolyregular;
font-size: 1.8vw;
overflow-y: hidden;
}
.instructions{
font-family:jolyregularitalic;
}
span.instructions_arrow{
padding-left:40px;
font-size: 2.4vw;
font-family:jolybolditalic;
}
::-moz-selection { /* Code for Firefox */
background: transparent;
}
::selection {
background: transparent;
}
#ground_color {
width: 5100px;
height: 120%;
position:fixed;
margin:-100px;
background-color: white;
z-index:-10;
}
#ground{
position:absolute;
height:100%;
width:3500px;
}
#groundline {
position: fixed;
top:130px;
width: 100%;
border-top: 1px solid;
z-index:-10;
}
div.text_container {
bottom: 40px;
left:40px;
right:40px;
position:fixed;
margin: auto;
line-height: 1.4em;
}
button{
-webkit-appearance: none;
background-color: white;
border: 0.1em black solid;
border-radius: 25em;
color:black;
cursor:pointer;
font-family: jolybolditalic;
}
button:hover{
border: 0.1em transparent solid;
-webkit-box-shadow: 0px 0px 8px 1px black;
-moz-box-shadow: 0px 0px 8px 1px black;
box-shadow: 0px 0px 8px 1px black;
}
.flipped {
transform: scale(-1, 1);
-moz-transform: scale(-1, 1);
-webkit-transform: scale(-1, 1);
-o-transform: scale(-1, 1);
-khtml-transform: scale(-1, 1);
-ms-transform: scale(-1, 1);
}
span.button_text{
font-size: 1.6vw;
padding: 8px;
}
#player_name{
font-family: jolybolditalic;
}
.duo{
position: absolute;
bottom: 25%;
left: 5%;
width: 200px;
height: 100px;
}
/*images*/
#tree1 {
bottom:30%;
left: 8%;
position: absolute;
z-index:-1;
}
#tree2 {
bottom:15%;
left: 22%;
position: absolute;
z-index:5;
}
#tree3 {
bottom:30%;
left: 40%;
position: absolute;
z-index:-1;
}
#tree4 {
bottom:15%;
left: 60%;
position: absolute;
z-index:5;
}
/* amanda baloons*/
.bubble1 {
right: 25%;
top:34%;
position: absolute;
background: #ffffff;
color: #000000;
font-family: sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 190px;
height: 50px;
border-radius: 10px;
padding: 18px;
border: #000000 solid 1px;
}
.bubble1:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-color: #ffffff transparent;
border-width: 0 20px 20px;
top: -20px;
left: 76%;
margin-left: -20px;
}
.bubble1:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-color: #000000 transparent;
border-width: 0 21px 21px;
top: -21.5px;
left: 76%;
margin-left: -21px;
display: block;
}
.bubble2{
right: 11%;
top:35%;
position: absolute;
background: #ffffff;
color: #000000;
font-family: sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 220px;
height: 75px;
border-radius: 10px;
padding: 18px;
border: #000000 solid 1px;
}
.bubble2:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-color: transparent #ffffff;
border-width: 20px 20px 20px 0;
top: 34%;
left: -20px;
margin-top: -20px;
}
.bubble2:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-color: transparent #000000;
border-width: 21px 21px 21px 0;
top: 34%;
left: -21.5px;
margin-top: -21px;
display: block;
}
.bubble3 {
right: 20%;
top:53%;
position: absolute;
background: #ffffff;
color: #000000;
font-family: sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 200px;
height: 55px;
border-radius: 10px;
padding: 18px;
border: #000000 solid 1px;
}
.bubble3:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-color: #ffffff transparent;
border-width: 0 20px 20px;
top: -20px;
left: 73%;
margin-left: -20px;
}
.bubble3:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-color: #000000 transparent;
border-width: 0 21px 21px;
top: -21.5px;
left: 73%;
margin-left: -21px;
display: block;
}
.bubble4{
right: 8%;
top:6%;
position: absolute;
background: #ffffff;
color: #000000;
font-family: sinistre;
font-size: 16px;
line-height: 17px;
text-align: center;
width: 190px;
height: 90px;
border-radius: 10px;
padding: 18px;
border: #000000 solid 1px;
}
.bubble4:after {
content: '';
position: absolute;
display: block;
width: 0;
z-index: 1;
border-style: solid;
border-color: transparent #ffffff;
border-width: 20px 20px 20px 0;
top: 34%;
left: -20px;
margin-top: -20px;
}
.bubble4:before {
content: '';
position: absolute;
width: 0;
z-index: 0;
border-style: solid;
border-color: transparent #000000;
border-width: 21px 21px 21px 0;
top: 34%;
left: -21.5px;
margin-top: -21px;
display: block;
}
/* hide scroll bar */
/* width */
::-webkit-scrollbar {
color:white;
}
/* Track */
::-webkit-scrollbar-track {
background: white;
}
/* Handle */
::-webkit-scrollbar-thumb {
background: white;
}
/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
background: white;
}

@ -0,0 +1,138 @@
<!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>chemtrails</title>
<link rel="icon" href="imgs/pleiadian_s/planet7.gif">
<link rel="stylesheet" href="major_house.css">
</head>
<body >
<div id="ground_color"></div>
<div id="groundline" ></div>
<div id="ground">
<div class="duo">
<span id="player_img"></span>
<img id="pat" src="imgs/cat_shelter/parrot.gif" height="100px">
</div>
<img id="tree1" src="imgs/cat_shelter/tree.gif" height="160px">
<img id="tree2" src="imgs/cat_shelter/tree.gif"height="160px">
<img id="tree3" src="imgs/cat_shelter/tree.gif" height="160px">
<img id="tree4" src="imgs/cat_shelter/tree.gif" height="160px">
<img id="tree5"src="imgs/cat_shelter/tree.gif" height="160px">
<div class="bubble1" style="display: none;">Hello <span id="player_name"></span>, your enlightened spirit guided you here.</div>
<div class="bubble2" style="display: none;">We can sense that you are looking for something beyond your habits and understanding. We are happy to meet you. </div>
<div class="bubble3" style="display: none;">We are the beings of light. We don't belong to this planet.</div>
<div class="bubble4" style="display: none;">We can sense the other beings and planet's energetic state. A heinous crime is shaking this land's vibration.</div>
<div class="bubble5" style="display: none;">This darkness will soon spread to other planets. We came here as messengers, to help you elevate your soul and find the courage to fight evil.</div>
<div class="text_container" >
<div class="message1">
<span class="instructions"><span class="instructions_arrow"></span> </span>
</div>
<div class="message2" style="display: none;">
</div>
<div class="message3" style="display: none;">
</div>
</div>
<script src="jquery.min.js"></script>
<script>
// saves game step in the local storage
window.onload = function() {
window.localStorage.setItem("pleiadians","opened");
console.log ("pleiadians:",localStorage.pleiadians);
}
//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
document.querySelector('#player_name').innerHTML = localStorage.playerName;
//adjust camera scroll
var $div = $('.duo');
var screenLeftMin = 50;
var screenLeftMax = 700;
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;
}
//check the offset and prevent the character to exceed the screen dimension
if (offset.left < 80) {
offset.left = 80;
}
if (offset.left > $("#ground").width() - 700) {
$(".message1").hide();
$(".message2").show();
}
if (offset.left > $("#ground").width() - 80) {
offset.left = $("#ground").width() - 80;
}
$div.css("left", offset.left);
$div.css("top", offset.top);
e.preventDefault();
adjustScroll();
})
</script>
<script type="text/javascript" src="index.js" ></script>
</body>
Loading…
Cancel
Save