2013-05-29 01:58:56 +00:00
|
|
|
/// <reference path="../../Phaser/Game.ts" />
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
|
|
|
var game = new Phaser.Game(this, 'game', 800, 600, init, create);
|
|
|
|
|
|
|
|
function init() {
|
|
|
|
|
|
|
|
// Using Phasers asset loader we load up a PNG from the assets folder
|
2013-06-05 01:58:16 +00:00
|
|
|
game.load.image('bunny', 'assets/sprites/bunny.png');
|
|
|
|
game.load.start();
|
2013-05-29 01:58:56 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var bunny: Phaser.Sprite;
|
|
|
|
var tweenUp: Phaser.Tween;
|
|
|
|
var tweenDown: Phaser.Tween;
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
|
|
|
|
// Here we'll assign the new sprite to the local bunny variable
|
|
|
|
bunny = game.add.sprite(0, 0, 'bunny');
|
|
|
|
|
2013-06-06 01:47:08 +00:00
|
|
|
bunny.transform.scale.setTo(0.5, 0.5);
|
2013-05-29 01:58:56 +00:00
|
|
|
|
2013-05-29 16:31:57 +00:00
|
|
|
// This time let's scale the sprite by a looped tween
|
2013-06-06 01:47:08 +00:00
|
|
|
game.add.tween(bunny.transform.scale).to({ x: 2, y: 2 }, 2000, Phaser.Easing.Elastic.Out, true, 0, true, true);
|
2013-05-29 01:58:56 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|