mirror of
https://github.com/wassname/phaser.git
synced 2026-06-28 16:20:37 +08:00
Mummy attack :)
This commit is contained in:
+10
-5
@@ -25,21 +25,26 @@
|
||||
|
||||
function create() {
|
||||
|
||||
bunny = game.add.sprite(-40, 100, 'ms');
|
||||
bunny = game.add.sprite(40, 100, 'ms');
|
||||
|
||||
bunny.animations.add('walk');
|
||||
|
||||
bunny.animations.play('walk', 50, true);
|
||||
|
||||
// bunny.scale.x = 8;
|
||||
// bunny.scale.y = 8;
|
||||
|
||||
game.add.tween(bunny).to({ x: game.width }, 10000, Phaser.Easing.Linear.None, true);
|
||||
|
||||
}
|
||||
|
||||
// update isn't called until 'create' has completed. If you need to process stuff before that point (i.e. while the preload is still happening)
|
||||
// then create a function called loadUpdate() and use that
|
||||
function update() {
|
||||
bunny.postUpdate();
|
||||
|
||||
if (bunny.x >= 300)
|
||||
{
|
||||
bunny.scale.x += 0.01;
|
||||
bunny.scale.y += 0.01;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user