Switch branches/tags
Nothing to show
Find file
084b065 May 23, 2011
46 lines (36 sloc) 1.45 KB
<!DOCTYPE html>
<title>My god, its full of stars!</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link href="stars.css" media="screen, print" rel="stylesheet" type="text/css" />
<div id="controls">
<img id='up' src='images/up.png' title="go up">
<img id='down' src='images/down.png' title="go down">
<img id='left' src='images/left.png' title="go left">
<img id='right' src='images/right.png' title="go right">
<canvas id="stars">
<div id="unsupported">
Sorry, this example cannot be run because your browser does not support the &lt;canvas&gt; element
<script src="game.js" type="text/javascript"></script>
<script src="stars.js" type="text/javascript"></script>
<script type="text/javascript">
Game.ready(function() {
var up = document.getElementById('up');
var down = document.getElementById('down');
var left = document.getElementById('left');
var right = document.getElementById('right');
var stars = Game.start('stars', Stars);
Game.addEvent(up, 'click', function() { stars.changeDirection('up'); });
Game.addEvent(down, 'click', function() { stars.changeDirection('down'); });
Game.addEvent(left, 'click', function() { stars.changeDirection('left'); });
Game.addEvent(right, 'click', function() { stars.changeDirection('right'); });