Phaser now running on iOS. Also fixed a legacy bug where a pending sound wouldn't play once it was touch unlocked. Also fixed Input not working on WebGL contexts. Added WebGL texture updates to the Group/World swap functions.

This commit is contained in:
Richard Davey
2013-09-10 16:46:39 +01:00
parent 5da0e42be4
commit a486bf6b4a
17 changed files with 338 additions and 201 deletions
+7
View File
@@ -8,6 +8,11 @@
</head>
<body>
<input type="text" id="mx" value="0" />
<input type="text" id="my" value="0" />
<br />
<script type="text/javascript">
(function () {
@@ -31,6 +36,8 @@
}
function update() {
document.getElementById('mx').value = game.input.x;
document.getElementById('my').value = game.input.y;
}
})();
+60
View File
@@ -0,0 +1,60 @@
<!DOCTYPE HTML>
<html>
<head>
<title>phaser.js - a new beginning</title>
<?php
require('js.php');
?>
<style type="text/css">
body {
margin: 0;
}
</style>
</head>
<body>
<script type="text/javascript">
(function () {
var game = new Phaser.Game(400, 300, Phaser.AUTO, '', { preload: preload, create: create, update: update });
function preload() {
game.load.image('mushroom', 'assets/sprites/mushroom2.png');
}
var m;
function create() {
// game.stage.canvas.style['-webkit-transform-origin'] = 'top left';
// game.stage.canvas.style['-webkit-transform'] = 'scale(3,3)';
// game.stage.scaleMode = Phaser.StageScaleMode.EXACT_FIT;
// game.stage.scale.
// game.stage.scale.setScreenSize();
m = game.add.sprite(0, 0, 'mushroom');
m.anchor.setTo(0.5, 0.5);
// game.input.onDown.add(newMushroom, this);
}
function newMushroom(pointer) {
// game.add.sprite(pointer.x, pointer.y, 'mushroom');
}
function update() {
m.x = game.input.x;
m.y = game.input.y;
}
})();
</script>
</body>
</html>
+1 -5
View File
@@ -26,7 +26,7 @@
function create() {
game.world._stage.backgroundColorString = '#182d3b';
game.stage.backgroundColor = '#182d3b';
music = game.add.audio('boden');
music.play();
@@ -37,15 +37,11 @@
}
function update() {
s.rotation += 0.01;
}
function render() {
game.debug.renderSoundInfo(music, 20, 32);
}
})();