2013-05-29 02:58:56 +01: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 02:58:16 +01:00
|
|
|
game.load.image('bunny', 'assets/sprites/bunny.png');
|
|
|
|
game.load.start();
|
2013-05-29 02:58:56 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var bigBunny: Phaser.Sprite;
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
|
|
|
|
// Here we'll assign the new sprite to the local bigBunny variable
|
|
|
|
bigBunny = game.add.sprite(0, 0, 'bunny');
|
|
|
|
|
|
|
|
// And now let's scale the sprite by two
|
|
|
|
|
|
|
|
// You can do either:
|
2013-06-06 02:47:08 +01:00
|
|
|
// smallBunny.transform.scale.x = 2;
|
|
|
|
// smallBunny.transform.scale.y = 2;
|
2013-05-29 02:58:56 +01:00
|
|
|
|
|
|
|
// Or you can set them both at the same time using setTo:
|
2013-06-06 02:47:08 +01:00
|
|
|
bigBunny.transform.scale.setTo(2, 2);
|
2013-05-29 02:58:56 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|