Fixed a bug stopping legacy Audio from starting correctly. Also fixed an issue in the Loader causing it to not load the next file if an unsupported audio file was encountered. Fixed audio playback issues on Firefox/Waterfox as a result.

This commit is contained in:
Richard Davey
2013-09-11 11:33:27 +01:00
parent e79dd5856d
commit 87858d6bbf
9 changed files with 722 additions and 752 deletions
+20 -2
View File
@@ -1,6 +1,7 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
@@ -15,9 +16,11 @@
var game = new Phaser.Game(800, 600, Phaser.CANVAS, '', { preload: preload, create: create, update: update, render: render });
function preload() {
game.load.image('disk', 'assets/sprites/ra_dont_crack_under_pressure.png');
//game.load.audio('wizball', ['assets/mp3/oedipus_wizball_highscore.ogg', 'assets/mp3/oedipus_wizball_highscore.mp3']);
game.load.audio('boden', ['assets/audio/bodenstaendig_2000_in_rock_4bit.mp3']);
// Firefox doesn't support mp3 files, so use ogg
game.load.audio('boden', ['assets/audio/bodenstaendig_2000_in_rock_4bit.mp3', 'assets/audio/bodenstaendig_2000_in_rock_4bit.ogg']);
}
@@ -34,6 +37,21 @@
s = game.add.sprite(game.world.centerX, game.world.centerY, 'disk');
s.anchor.setTo(0.5, 0.5);
game.input.onDown.add(changeVolume, this);
}
function changeVolume(pointer) {
if (pointer.y < 300)
{
music.volume += 0.1;
}
else
{
music.volume -= 0.1;
}
}
function update() {