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

View File

@ -10,8 +10,9 @@ padding: 0;
-ms-user-select: none;
user-select: none;
font-family: "Londrina Solid";
box-sizing: border-box;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
html {
height: 100%;
@ -31,6 +32,91 @@ vertical-align: middle;
overflow: hidden;
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 {
width: 100%;
height: 100%;
@ -230,8 +316,8 @@ height: 175px;
position: absolute;
top: 0px;
left: 0px;
margin-top: 0px;
margin-left: 0px;
margin-top: -82.5px;
margin-left: -50px;
background: url(assets/eknife.png);
background-size: 100% 100%;
z-index: 1;

26
main.js
View File

@ -15,25 +15,43 @@ weapon: 0
};
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) {
return Math.atan2(bx-x, by-y)/Math.PI*-180;
}
function dpf() {
map.panBy(0, -step);
player.x-=step;
player.x -= step;
}
function dpb() {
map.panBy(0, step);
player.x+=step;
player.x += step;
}
function dpl() {
map.panBy(-step, 0);
player.y-=step;
player.y -= step;
}
function dpr() {
map.panBy(step, 0);
player.y+=step;
player.y += step;
}
window.addEventListener('load', function(e) {