Skip to content

Instantly share code, notes, and snippets.

@koreus7
Created August 9, 2015 19:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koreus7/06bee4a30d22bdc76d62 to your computer and use it in GitHub Desktop.
Save koreus7/06bee4a30d22bdc76d62 to your computer and use it in GitHub Desktop.
// app.js
define(["require", "exports", "Player"], function (require, exports, player) {
var PhaserDemo = (function () {
function PhaserDemo() {
this.game = new Phaser.Game(800, 600, Phaser.WEBGL, 'content', { preload: this.preload, create: this.create });
}
PhaserDemo.prototype.preload = function () {
this.game.load.image('phaser_run', 'run.png');
};
PhaserDemo.prototype.create = function () {
this.game.stage.backgroundColor = "#000000";
var p = new player.Player();
console.log(p);
p.pos.x = this.game.stage.width / 2 - p.radius / 2;
p.pos.y = this.game.stage.height / 2 - p.radius / 2;
};
return PhaserDemo;
})();
window.onload = function () {
console.log("ONLOAD");
var game = new PhaserDemo();
};
});
//# sourceMappingURL=app.js.map
// Player.js
define(["require", "exports"], function (require, exports) {
var Player = (function () {
function Player() {
this.pos = new Phaser.Point(0, 0);
this.radius = 100;
}
return Player;
})();
exports.Player = Player;
});
//# sourceMappingURL=Player.js.map
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment