From 373e5f472f829714939103617cfe14e98d981b18 Mon Sep 17 00:00:00 2001 From: Justin Worthe Date: Sun, 21 Sep 2014 08:00:06 +0200 Subject: Removed unused states and templating of main.js --- game/plugins/orientation.js | 40 ---------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 game/plugins/orientation.js (limited to 'game/plugins/orientation.js') diff --git a/game/plugins/orientation.js b/game/plugins/orientation.js deleted file mode 100644 index 8ab922b..0000000 --- a/game/plugins/orientation.js +++ /dev/null @@ -1,40 +0,0 @@ -'use strict'; - -var Orientation = function() { - var self = this; - - self.onLeft = new Phaser.Signal(); - self.onRight = new Phaser.Signal(); - self.onUp = new Phaser.Signal(); - self.onDown = new Phaser.Signal(); - - self.previousEvent = { - gamma: 0, - beta: 0 - }; - - self.threshhold = 15; - - if (window.DeviceOrientationEvent) { - window.addEventListener('deviceorientation', function(eventData) { - if (eventData.gamma < -self.threshhold && self.previousEvent.gamma >= -self.threshhold) { - self.onLeft.dispatch(); - } - if (eventData.gamma > self.threshhold && self.previousEvent.gamma <= self.threshhold) { - self.onRight.dispatch(); - } - if (eventData.beta < -self.threshhold && self.previousEvent.beta >= -self.threshhold) { - self.onUp.dispatch(); - } - if (eventData.beta > self.threshhold && self.previousEvent.beta <= self.threshhold) { - self.onDown.dispatch(); - } - - self.previousEvent.gamma = eventData.gamma; - self.previousEvent.beta = eventData.beta; - }); - } -}; - - -module.exports = Orientation; -- cgit v1.2.3