New Input handler implemented.

This commit is contained in:
Richard Davey
2013-05-16 02:36:58 +01:00
parent ce7bfd1fc2
commit 3cdd2baff0
31 changed files with 3048 additions and 2029 deletions
+12 -5
View File
@@ -1,16 +1,23 @@
/// <reference path="../../Phaser/Game.ts" />
(function () {
// Here we create a quite tiny game (320x240 in size)
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update);
var myGame = new Phaser.Game(this, 'game', 800, 600, init, create, update, render);
function init() {
// Tell Phaser that we want it to scale up to whatever the browser can handle, but to do it proportionally
myGame.stage.scaleMode = Phaser.StageScaleMode.SHOW_ALL;
myGame.loader.addImageFile('dragonsun', 'assets/pics/cougar_dragonsun.png');
myGame.loader.load();
}
function create() {
myGame.onRenderCallback = render;
console.log('dragons 8');
myGame.input.onDown.add(test1, this);
}
function test1() {
console.log('down');
}
function update() {
}
function render() {
myGame.input.pointer1.renderDebug();
myGame.input.pointer2.renderDebug();
myGame.input.pointer3.renderDebug();
myGame.input.pointer4.renderDebug();
}
})();