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
+2 -3
View File
@@ -1,6 +1,6 @@
/// <reference path="../../Phaser/Game.ts" />
(function () {
var myGame = new Phaser.Game(this, 'game', 320, 460, init, create, update);
var myGame = new Phaser.Game(this, 'game', 320, 460, init, create, update, render);
function init() {
myGame.loader.addImageFile('bunny', 'assets/sprites/wabbit.png');
myGame.loader.load();
@@ -15,12 +15,11 @@
minY = 0;
maxX = myGame.stage.width - 26;
maxY = myGame.stage.height - 37;
myGame.input.touch.touchDown.add(addBunnies, this);
myGame.input.onDown.add(addBunnies, this);
// This will really help on slow Android phones
myGame.framerate = 30;
// Make sure the camera doesn't clip anything
myGame.camera.disableClipping = true;
myGame.onRenderCallback = render;
myGame.stage.context.fillStyle = 'rgb(255,0,0)';
myGame.stage.context.font = '20px Arial';
addBunnies();
+2 -3
View File
@@ -2,7 +2,7 @@
(function () {
var myGame = new Phaser.Game(this, 'game', 320, 460, init, create, update);
var myGame = new Phaser.Game(this, 'game', 320, 460, init, create, update, render);
function init() {
@@ -26,14 +26,13 @@
maxX = myGame.stage.width - 26;
maxY = myGame.stage.height - 37;
myGame.input.touch.touchDown.add(addBunnies, this);
myGame.input.onDown.add(addBunnies, this);
// This will really help on slow Android phones
myGame.framerate = 30;
// Make sure the camera doesn't clip anything
myGame.camera.disableClipping = true;
myGame.onRenderCallback = render;
myGame.stage.context.fillStyle = 'rgb(255,0,0)';
myGame.stage.context.font = '20px Arial';