forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow5.php
More file actions
57 lines (43 loc) · 1.2 KB
/
Copy pathflow5.php
File metadata and controls
57 lines (43 loc) · 1.2 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
</head>
<body>
<script type="text/javascript">
(function () {
var mainMenu = {
preload: function() {
console.log('mainMenu preload');
game.load.image('nocooper', 'assets/pics/1984-nocooper-space.png');
},
create: function() {
console.log('mainMenu create');
document.body.appendChild(game.cache.getImage('nocooper'));
}
}
var levelSelect = {
preload: function() {
console.log('levelSelect preload');
game.load.image('touhou', 'assets/pics/aya_touhou_teng_soldier.png');
},
create: function() {
console.log('levelSelect create');
document.body.appendChild(game.cache.getImage('touhou'));
}
}
// No parameters given, which means no default state is created or started
var game = new Phaser.Game();
// In this example we've created 2 states above (mainMenu and levelSelect)
// We'll add them both to the game
game.state.add('menu', mainMenu);
game.state.add('select', levelSelect);
// Now we can either start the state we want directly, or we could have passed 'true' as the 3rd parameter in state.add
game.state.start('select');
})();
</script>
</body>
</html>