mirror of
https://github.com/photonstorm/phaser
synced 2024-11-23 13:13:43 +00:00
18 lines
765 B
JavaScript
18 lines
765 B
JavaScript
|
/// <reference path="../../Phaser/Game.ts" />
|
||
|
(function () {
|
||
|
var game = new Phaser.Game(this, 'game', 800, 600, init, create);
|
||
|
function init() {
|
||
|
game.load.atlas('atlas', 'assets/sprites/invaderpig.png', 'assets/sprites/invaderpig.json');
|
||
|
game.load.start();
|
||
|
}
|
||
|
var pig;
|
||
|
var invader;
|
||
|
function create() {
|
||
|
game.stage.backgroundColor = 'rgb(40, 40, 40)';
|
||
|
pig = game.add.sprite(200, 200, 'atlas', 'tennyson');
|
||
|
invader = game.add.sprite(0, 0, 'atlas', 'invader1');
|
||
|
console.log(pig.width, pig.height, pig.body.bounds.width, pig.body.bounds.height, pig.worldView);
|
||
|
console.log(invader.width, invader.height, invader.body.bounds.width, invader.body.bounds.height, invader.worldView);
|
||
|
}
|
||
|
})();
|