|
|
@ -19,6 +19,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
<div id="player_img"></div>
|
|
|
|
<div id="player_img"></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<div id="ground">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<img id="bench" src="imgs/park/bench1.gif" height="20%">
|
|
|
|
<img id="bench" src="imgs/park/bench1.gif" height="20%">
|
|
|
@ -35,6 +39,9 @@
|
|
|
|
<img id="grass2" src="imgs/park/grass1.gif" height="75vw">
|
|
|
|
<img id="grass2" src="imgs/park/grass1.gif" height="75vw">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -46,25 +53,34 @@ move
|
|
|
|
<script src="jquery.min.js"></script>
|
|
|
|
<script src="jquery.min.js"></script>
|
|
|
|
<script>
|
|
|
|
<script>
|
|
|
|
|
|
|
|
|
|
|
|
//move
|
|
|
|
// player moves
|
|
|
|
|
|
|
|
|
|
|
|
var $div = $('#player_img');
|
|
|
|
var $div = $('#player_img');
|
|
|
|
|
|
|
|
|
|
|
|
$(document).keydown(function(e) {
|
|
|
|
$(document).keydown(function(e) {
|
|
|
|
switch (e.which) {
|
|
|
|
switch (e.which) {
|
|
|
|
case 37:
|
|
|
|
case 37:
|
|
|
|
$div.css('left', $div.offset().left - 20);
|
|
|
|
$div.css('left', $div.offset().left - 20);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 38:
|
|
|
|
case 38:
|
|
|
|
$div.css('top', $div.offset().top - 20);
|
|
|
|
$div.css('top', $div.offset().top - 20);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 39:
|
|
|
|
case 39:
|
|
|
|
$div.css('left', $div.offset().left + 20);
|
|
|
|
$div.css('left', $div.offset().left + 20);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case 40:
|
|
|
|
case 40:
|
|
|
|
$div.css('top', $div.offset().top + 20);
|
|
|
|
$div.css('top', $div.offset().top + 20);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
//get player avatar from local storage
|
|
|
|
|
|
|
|
|
|
|
|
// 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)
|
|
|
|
console.log (localStorage.myavatar)
|
|
|
|
var img = document.createElement("img");
|
|
|
|
var img = document.createElement("img");
|
|
|
|
img.src = localStorage.myavatar;
|
|
|
|
img.src = localStorage.myavatar;
|
|
|
|