1
0
Fork 0

Temporary commit

master
Ambrose Chua 2013-06-20 17:09:46 +08:00
parent b6623a532d
commit d3f24e7024
3 changed files with 123 additions and 7 deletions

View File

@ -9,6 +9,13 @@
<meta name="author" content="ambc"> <meta name="author" content="ambc">
</head> </head>
<body> <body>
<div id="loading">
<div id="loadingc">
<div class="loading"></div>
Loading...
</div>
</div>
<div id="tgp">Pause</div> <div id="tgp">Pause</div>
<div id="bar"> <div id="bar">
@ -98,5 +105,10 @@ var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions)
</script> </script>
<script type="text/javascript" src="main.js"></script> <script type="text/javascript" src="main.js"></script>
<script type="text/javascript">
$(window).load(function () {
$("#loading").fadeOut(300, function() { $(this).remove(); });
});
</script>
</body> </body>
</html> </html>

View File

@ -10,8 +10,9 @@ padding: 0;
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
font-family: "Londrina Solid"; font-family: "Londrina Solid";
box-sizing: border-box;
-webkit-box-sizing: border-box; -webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
} }
html { html {
height: 100%; height: 100%;
@ -31,6 +32,91 @@ vertical-align: middle;
overflow: hidden; overflow: hidden;
cursor: url(assets/cursor.png) 4 4, auto; cursor: url(assets/cursor.png) 4 4, auto;
} }
#loading {
background-color: #aaa;
color: rgba(0, 0, 0, 0.5);
text-align: center;
z-index: 9990;
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
backface-visibility: hidden;
}
#loadingc {
position: absolute;
top: 50%;
left: 50%;
z-index: 9999;
margin: -50px 0 0 -100px;
height: 100px;
width: 200px;
font-size: 20px;
}
@keyframes loading {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes loading {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
@-webkit-keyframes loading {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-ms-keyframes loading {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-o-keyframes loading {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
.loading {
width: 20px;
height: 20px;
margin-right: 0px;
background-color: rgba(0, 0, 0, 0.5);
border-radius: 10px;
border-top-right-radius: 0px;
-webkit-border-radius: 10px;
-webkit-border-top-right-radius: 0px;
-moz-border-radius: 10px;
-moz-border-top-right-radius: 0px;
-o-border-radius: 10px;
-o-border-top-right-radius: 0px;
-ms-border-radius: 10px;
-ms-border-top-right-radius: 0px;
animation: loading 1s infinite;
-webkit-animation: loading 1s infinite;
-moz-animation: loading 1s infinite;
-o-animation: loading 1s infinite;
-ms-animation: loading 1s infinite;
display: inline-block;
}
#map_canvas { #map_canvas {
width: 100%; width: 100%;
height: 100%; height: 100%;
@ -230,8 +316,8 @@ height: 175px;
position: absolute; position: absolute;
top: 0px; top: 0px;
left: 0px; left: 0px;
margin-top: 0px; margin-top: -82.5px;
margin-left: 0px; margin-left: -50px;
background: url(assets/eknife.png); background: url(assets/eknife.png);
background-size: 100% 100%; background-size: 100% 100%;
z-index: 1; z-index: 1;

26
main.js
View File

@ -15,25 +15,43 @@ weapon: 0
}; };
var evil=[]; var evil=[];
function spawnevil() {
newevil=$('<div class="evil"></div>');
where=Math.floor(Math.random()+0.5);
if (where==0) {
top=0;
left=Math.floor(Math.random()*window.innerWidth+0.5);
}
else if (where==1) {
left=0;
top=Math.floor(Math.random()*window.innerHeight+0.5);
}
else {
alert("A bug has occured!");
}
newevil.css("left", left+"px");
newevil.css("top", top+"px");
}
function angle(x, y, bx, by) { function angle(x, y, bx, by) {
return Math.atan2(bx-x, by-y)/Math.PI*-180; return Math.atan2(bx-x, by-y)/Math.PI*-180;
} }
function dpf() { function dpf() {
map.panBy(0, -step); map.panBy(0, -step);
player.x-=step; player.x -= step;
} }
function dpb() { function dpb() {
map.panBy(0, step); map.panBy(0, step);
player.x+=step; player.x += step;
} }
function dpl() { function dpl() {
map.panBy(-step, 0); map.panBy(-step, 0);
player.y-=step; player.y -= step;
} }
function dpr() { function dpr() {
map.panBy(step, 0); map.panBy(step, 0);
player.y+=step; player.y += step;
} }
window.addEventListener('load', function(e) { window.addEventListener('load', function(e) {