mirror of
https://github.com/wassname/phaser.git
synced 2026-08-06 13:31:05 +08:00
Lots of fixes and updates to the Button class, InputHandler for snap offsets, Sound looping and Stage scaling.
This commit is contained in:
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 8.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 29 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
@@ -0,0 +1,46 @@
|
||||
|
||||
var game = new Phaser.Game(800, 600, Phaser.CANVAS, 'phaser-example', { preload: preload, create: create, update: update, render: render });
|
||||
|
||||
function preload() {
|
||||
|
||||
game.load.audio('music', 'assets/audio/CatAstroPhi_shmup_normal.wav');
|
||||
|
||||
}
|
||||
|
||||
var music;
|
||||
|
||||
function create() {
|
||||
|
||||
music = game.add.audio('music');
|
||||
|
||||
// play: function (marker, position, volume, loop, forceRestart) {
|
||||
|
||||
music.play('', 0, 1, true);
|
||||
|
||||
game.input.onDown.add(toggleAudio, this);
|
||||
|
||||
}
|
||||
|
||||
function toggleAudio() {
|
||||
|
||||
if (music.isPlaying)
|
||||
{
|
||||
music.pause();
|
||||
}
|
||||
else
|
||||
{
|
||||
music.resume();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
game.debug.renderSoundInfo(music, 32, 32);
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user