2013-06-03 00:22:14 +00:00
|
|
|
/// <reference path="../../Phaser/Game.ts" />
|
|
|
|
|
|
|
|
(function () {
|
|
|
|
|
2013-08-08 03:35:13 +00:00
|
|
|
var game = new Phaser.Game(this, 'game', 800, 600, preload, create, null, render);
|
2013-06-03 00:22:14 +00:00
|
|
|
|
2013-08-08 03:35:13 +00:00
|
|
|
function preload() {
|
2013-06-03 00:22:14 +00:00
|
|
|
|
|
|
|
// Using Phasers asset loader we load up a PNG from the assets folder
|
2013-06-05 01:58:16 +00:00
|
|
|
game.load.image('atari1', 'assets/sprites/atari130xe.png');
|
|
|
|
game.load.image('atari2', 'assets/sprites/atari800xl.png');
|
|
|
|
game.load.image('sonic', 'assets/sprites/sonic_havok_sanity.png');
|
2013-08-08 03:35:13 +00:00
|
|
|
|
2013-06-03 00:22:14 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var atari1: Phaser.Sprite;
|
|
|
|
var atari2: Phaser.Sprite;
|
|
|
|
var sonic: Phaser.Sprite;
|
|
|
|
|
|
|
|
function create() {
|
|
|
|
|
|
|
|
atari1 = game.add.sprite(100, 100, 'atari1');
|
|
|
|
atari2 = game.add.sprite(300, 200, 'atari2');
|
|
|
|
sonic = game.add.sprite(400, 300, 'sonic');
|
|
|
|
|
|
|
|
atari1.input.start(0, false, true);
|
|
|
|
atari2.input.start(1, false, true);
|
|
|
|
sonic.input.start(2, false, true);
|
|
|
|
|
|
|
|
atari1.input.enableDrag();
|
|
|
|
atari2.input.enableDrag();
|
|
|
|
sonic.input.enableDrag();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function render() {
|
2013-08-06 23:00:12 +00:00
|
|
|
Phaser.DebugUtils.renderInputInfo(32, 32);
|
2013-06-03 00:22:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
})();
|