2013-05-29 14:45:34 +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('fuji', 'assets/pics/atari_fujilogo.png');
|
|
|
|
game.load.start();
|
2013-05-29 14:45:34 +00:00
|
|
|
}
|
|
|
|
var fuji;
|
|
|
|
function create() {
|
|
|
|
game.stage.backgroundColor = 'rgb(0,0,100)';
|
|
|
|
// Here we'll assign the new sprite to the local fuji variable
|
2013-05-29 16:31:57 +00:00
|
|
|
fuji = game.add.sprite(game.stage.centerX, game.stage.centerY, 'fuji');
|
2013-05-29 14:45:34 +00:00
|
|
|
// The sprite is 320 x 200 pixels in size
|
|
|
|
// Here we set the origin to the center of the sprite (half of its width and height, so 160x100)
|
|
|
|
// This will cause it to rotate on its center
|
|
|
|
fuji.origin.setTo(160, 100);
|
2013-05-29 16:31:57 +00:00
|
|
|
game.add.tween(fuji).to({
|
2013-05-31 18:28:16 +00:00
|
|
|
angle: 360
|
2013-05-29 16:31:57 +00:00
|
|
|
}, 2000, Phaser.Easing.Linear.None, true, 0, true);
|
2013-05-29 14:45:34 +00:00
|
|
|
}
|
|
|
|
})();
|