|
|
|
@ -3,13 +3,13 @@
|
|
|
|
|
<head>
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
|
|
|
|
|
player_pos = [300, 0];
|
|
|
|
|
enemy_pos = [300, 0];
|
|
|
|
|
pewpew = 0;
|
|
|
|
|
player_pos = [300, 0];
|
|
|
|
|
enemy_pos = [300, 0];
|
|
|
|
|
pewpew = 0;
|
|
|
|
|
|
|
|
|
|
document.onkeydown = onKeyDown;
|
|
|
|
|
document.onkeydown = onKeyDown;
|
|
|
|
|
|
|
|
|
|
function onKeyDown(e) {
|
|
|
|
|
function onKeyDown(e) {
|
|
|
|
|
e = e || window.event;
|
|
|
|
|
|
|
|
|
|
var player = document.getElementById("player");
|
|
|
|
@ -23,13 +23,13 @@
|
|
|
|
|
if (e.keyCode == '32') { // space = fire
|
|
|
|
|
shoot(player_pos);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
shoots = [];
|
|
|
|
|
function shoot(player_pos) {
|
|
|
|
|
shoots = [];
|
|
|
|
|
function shoot(player_pos) {
|
|
|
|
|
shoots[shoots.length] = [player_pos[0], 500];
|
|
|
|
|
// pewpew = 5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function isCollided(a, b) {
|
|
|
|
|
var a_left = parseInt(a.style.left);
|
|
|
|
|