Lots of fixes and updates to the Button class, InputHandler for snap offsets, Sound looping and Stage scaling.

This commit is contained in:
photonstorm
2013-12-31 17:03:09 +00:00
parent 86f6ddcbc8
commit d1cd1df9a5
13 changed files with 377 additions and 149 deletions
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

+46
View File
@@ -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);
}