-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
38 lines (31 loc) · 1007 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<!doctype html>
<html>
<head>
<meta charset="UTF-8" />
<title>Killian - Phaser Demo</title>
<script src="http://cdn.jsdelivr.net/phaser/2.4.3/phaser.min.js"></script>
<script src="Killian.js"></script>
<script src="stateMachine.js"></script>
</head>
<body>
Press the RIGHT arrow key to change state.
<br/><br/>
<div id="state"></div>
<script type="text/javascript">
window.onload = function() {
var game = new Phaser.Game(320, 240, Phaser.AUTO, '', { preload: preload, create: create, update: update });
var killian;
function preload () {
game.stage.backgroundColor = 0xFFFFFF;
game.load.atlas('killian', 'assets/sprites/killian.png', 'assets/sprites/killian.json',Phaser.Loader.TEXTURE_ATLAS_JSON_HASH);
}
function create () {
killian = new Killian( game, -50, -100 );
}
function update(){
document.getElementById('state').innerHTML = "<b>state:</b> " + killian.sm.currentState;
}
}
</script>
</body>
</html>