mirror of
https://github.com/wassname/phaser.git
synced 2026-08-08 11:23:41 +08:00
Added ability for full Audio tag playback and iOS touch lock load support.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/// <reference path="../../Phaser/Game.ts" />
|
||||
/// <reference path="../../Phaser/sound/SoundManager.ts" />
|
||||
/// <reference path="../../Phaser/sound/Sound.ts" />
|
||||
//var PhaserGlobal = { disableWebAudio: true };
|
||||
//var PhaserGlobal = { fakeiOSTouchLock: true, disableWebAudio: true };
|
||||
(function () {
|
||||
var game = new Phaser.Game(this, 'game', 800, 600, init, create, null, render);
|
||||
function init() {
|
||||
@@ -9,7 +9,6 @@
|
||||
game.load.audio('boden', [
|
||||
'assets/mp3/bodenstaendig_2000_in_rock_4bit.mp3'
|
||||
]);
|
||||
//game.load.audio('boden', ['assets/mp3/puzzleover.mp3']);
|
||||
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
|
||||
game.load.start();
|
||||
}
|
||||
@@ -26,10 +25,10 @@ Phaser.Button
|
||||
function create() {
|
||||
this.music = game.add.audio('boden');
|
||||
this.button = game.add.button(game.stage.centerX, 400, 'button', playMusic, this, 2, 1, 0);
|
||||
this.volumeUp = game.add.button(0, 0, 'button', volUp, this, 2, 1, 0);
|
||||
this.volumeDown = game.add.button(700, 0, 'button', volDown, this, 2, 1, 0);
|
||||
this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
|
||||
}
|
||||
//this.volumeUp = game.add.button(0, 0, 'button', volUp, this, 2, 1, 0);
|
||||
//this.volumeDown = game.add.button(700, 0, 'button', volDown, this, 2, 1, 0);
|
||||
//this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
|
||||
}
|
||||
function render() {
|
||||
this.music.renderDebug(0, 300);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/// <reference path="../../Phaser/sound/SoundManager.ts" />
|
||||
/// <reference path="../../Phaser/sound/Sound.ts" />
|
||||
|
||||
//var PhaserGlobal = { disableWebAudio: true };
|
||||
//var PhaserGlobal = { fakeiOSTouchLock: true, disableWebAudio: true };
|
||||
|
||||
(function () {
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
|
||||
//game.load.audio('wizball', ['assets/mp3/oedipus_wizball_highscore.ogg', 'assets/mp3/oedipus_wizball_highscore.mp3']);
|
||||
game.load.audio('boden', ['assets/mp3/bodenstaendig_2000_in_rock_4bit.mp3']);
|
||||
//game.load.audio('boden', ['assets/mp3/puzzleover.mp3']);
|
||||
game.load.spritesheet('button', 'assets/buttons/button_sprite_sheet.png', 193, 71);
|
||||
game.load.start();
|
||||
|
||||
@@ -29,16 +28,14 @@
|
||||
this.music = game.add.audio('boden');
|
||||
|
||||
this.button = game.add.button(game.stage.centerX, 400, 'button', playMusic, this, 2, 1, 0);
|
||||
this.volumeUp = game.add.button(0, 0, 'button', volUp, this, 2, 1, 0);
|
||||
this.volumeDown = game.add.button(700, 0, 'button', volDown, this, 2, 1, 0);
|
||||
this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
|
||||
//this.volumeUp = game.add.button(0, 0, 'button', volUp, this, 2, 1, 0);
|
||||
//this.volumeDown = game.add.button(700, 0, 'button', volDown, this, 2, 1, 0);
|
||||
//this.pause = game.add.button(200, 200, 'button', togglePause, this, 2, 1, 0);
|
||||
|
||||
}
|
||||
|
||||
function render() {
|
||||
|
||||
this.music.renderDebug(0, 300);
|
||||
|
||||
}
|
||||
|
||||
function togglePause() {
|
||||
|
||||
Reference in New Issue
Block a user