This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Adds aliases to any Object so that they can be used more semantically in code | |
* | |
* @method Phaser.Utils#propertyAlias | |
* @param {propetyName} obj - The object to add an alias to | |
* @param {string} [propertyName] - the current property name to alias | |
* @param {string} [aliasName] - the alias | |
* @static | |
* @example | |
* Phaser.Utils.propertyAlias(Phaser.Point.prototype, 'x', 'width'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
define(['phaser'], function(Phaser) { | |
function Gesture(game) { | |
this.game = game; | |
this.swipeDispatched = false; | |
this.holdDispatched = false; | |
this.isTouching = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.onload = function() | |
{ | |
var game = new Phaser.Game(window.innerWidth, window.innerHeight, Phaser.AUTO, '', { | |
preload: preload, | |
create: create, | |
update: update | |
}); | |
var dragging = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this is an ingenius hack that allows us to run Phaser without a browser | |
// ... and yes, it took some time to figure out how to do this | |
var Canvas = require('canvas') | |
, jsdom = require('jsdom') | |
, document = jsdom.jsdom(null) | |
, window = document.parentWindow | |
, Phaser; | |
// expose a few things to all the modules |