mirror of
https://github.com/wassname/phaser.git
synced 2026-09-12 12:40:47 +08:00
yuidoc scripts added. Tidied up the Docs folder. Added back in the Emitter and fixed the Tests that weren't compiling.
This commit is contained in:
@@ -13,22 +13,24 @@
|
||||
function create() {
|
||||
// background sky, which does not move at all
|
||||
game.add.sprite(0, 0, 'sky').transform.scrollFactor.setTo(0, 0);
|
||||
|
||||
// clouds with different scroll factor which moves slower than camera
|
||||
game.add.sprite(200, 120, 'cloud0').transform.scrollFactor.setTo(0.3, 0.3);
|
||||
game.add.sprite(-60, 120, 'cloud1').transform.scrollFactor.setTo(0.5, 0.3);
|
||||
game.add.sprite(900, 170, 'cloud2').transform.scrollFactor.setTo(0.7, 0.3);
|
||||
|
||||
// forground objects which moves equal or faster than camera
|
||||
game.add.sprite(0, 360, 'ground').transform.scrollFactor.setTo(0.5, 0.5);
|
||||
game.add.sprite(0, 400, 'river').transform.scrollFactor.setTo(1.3, 1.3);
|
||||
}
|
||||
function update() {
|
||||
if(game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
|
||||
if (game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) {
|
||||
game.camera.x -= 3;
|
||||
} else if(game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
|
||||
} else if (game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) {
|
||||
game.camera.x += 3;
|
||||
}
|
||||
}
|
||||
function render() {
|
||||
// game.camera.renderDebugInfo(32, 32);
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user