master
*anna* 4 years ago
parent d7cdd8de91
commit b382ba6d21

@ -48,11 +48,19 @@
#player_img {
bottom: 35%;
left: 35%;
position:absolute;
position:absolute ;
z-index: 20;
}
#ground{
position:relative ;
width:4000px;
}
#groundline {
position: fixed;
bottom:0px;

@ -189,16 +189,9 @@ $(document).keydown(function(e) {
});
$("#arrow_back1").click (function(){
$("#baloon1").hide();
$("#baloon2").hide();
$(".school2").hide();
$(".message2").hide();
$(".school3").hide();
$("#baloon3").hide();
$("#baloon4").hide();
$(".index").show();
$(".school1").show();
$(".message4").show();
$("#baloon1, #baloon2, #baloon3, #baloon4, .school2,.school3").hide();
$(".index, .school1, .message4").show();
});
$("#arrow_go2").click (function(){

@ -18,6 +18,10 @@
<div id="groundline"></div>
<div id="player_img"></div>
<div id="ground">
@ -33,6 +37,9 @@
<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">
</div>
@ -46,25 +53,34 @@ move
<script src="jquery.min.js"></script>
<script>
//move
// player moves
var $div = $('#player_img');
$(document).keydown(function(e) {
switch (e.which) {
case 37:
$div.css('left', $div.offset().left - 20);
$div.css('left', $div.offset().left - 20);
break;
case 38:
$div.css('top', $div.offset().top - 20);
$div.css('top', $div.offset().top - 20);
break;
case 39:
$div.css('left', $div.offset().left + 20);
$div.css('left', $div.offset().left + 20);
break;
case 40:
$div.css('top', $div.offset().top + 20);
$div.css('top', $div.offset().top + 20);
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)
var img = document.createElement("img");
img.src = localStorage.myavatar;

Loading…
Cancel
Save