neingeist
/
30shooter
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

76 lines
1.4 KiB
HTML

12 years ago
<html>
<head>
<script type="text/javascript">
cur_step = 10;
t = -Math.PI/2;
function timed() {
var el = document.getElementById("herzle");
el.style.position = "absolute";
el.style.left = ( Math.cos(t) + 1)/2 * window.innerWidth;
el.style.top = ((Math.sin(t)*Math.cos(t)) + 1)/2 * window.innerHeight;
el.style.fontSize = (1.0 - Math.abs(Math.cos(t))) * 300;
t = t + 0.1;
if (t > 3*Math.PI/2) {
t = -Math.PI/2;
}
12 years ago
// setTimeout("timed()", 100);
}
player_pos = 0;
document.onkeydown = onKeyDown;
function onKeyDown(e) {
e = e || window.event;
var player = document.getElementById("player");
if (e.keyCode == '37') { // left
player_pos -= 10;
player.style.left = player_pos;
}
if (e.keyCode == '39') { // right
player_pos += 10;
player.style.left = player_pos;
}
if (e.keyCode == '32') { // space = fire
var pewpew = document.getElementById("pewpew");
pewpew.innerHTML = "pew! pew!";
}
12 years ago
}
</script>
12 years ago
<style type="text/css">
* {
font-size: 20pt;
color: #ff00ff;
font-family: helvetica, arial;
}
#player {
position: absolute;
bottom: 10%;
}
#pewpew {
position:absolute;
top: 10%;
right: 10%;
}
</style>
12 years ago
</head>
12 years ago
<body>
<span id="herzle">&lt;3</span>
<span id="player">&lt;</span>
<span id="pewpew"></span>
12 years ago
</body>
</html>