forked from phaserjs/phaser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloop.php
More file actions
46 lines (24 loc) · 780 Bytes
/
Copy pathloop.php
File metadata and controls
46 lines (24 loc) · 780 Bytes
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
<?php
$title = "Using samples and looping";
require('../head.php');
?>
<script type="text/javascript">
var game = new Phaser.Game(800, 600, Phaser.AUTO, '', { preload: preload, create: create});
function preload() {
game.load.image('spyro', 'assets/pics/spyro.png');
// Firefox doesn't support mp3 files, so use ogg
game.load.audio('squit', ['assets/audio/SoundEffects/squit.mp3', 'assets/audio/SoundEffects/squit.ogg']);
}
var s;
var music;
function create() {
game.stage.backgroundColor = '#255d3b';
music = game.add.audio('squit',1,true);
music.play('',0,1,true);
s = game.add.sprite(game.world.centerX, game.world.centerY, 'spyro');
s.anchor.setTo(0.5, 0.5);
}
</script>
<?php
require('../foot.php');
?>