src/gamecontroller.js
function() {
			var _this = this;
			this.canvas = document.createElement('canvas');
			// Scale to same size as original canvas
			this.resize(true);
			document.body.appendChild(this.canvas);
			this.ctx = this.canvas.getContext( '2d');
			window.addEventListener( 'resize', function() {
				setTimeout(function(){ GameController.resize.call(_this); }, 10);
			});

			// Set the touch events for this new canvas
			this.setTouchEvents();

			// Load in the initial UI elements
			this.loadSide('left');
			this.loadSide('right');

			// Starts up the rendering / drawing
			this.render();

			// pause until a touch event
			if( !this.touches || !this.touches.length ) this.paused = true;
		}
function() {
			var _this = this;
			this.canvas = document.createElement('canvas');
			// Scale to same size as original canvas
			this.resize(true);
			document.body.appendChild(this.canvas);
			this.ctx = this.canvas.getContext( '2d');
			window.addEventListener( 'resize', function() {
				setTimeout(function(){ GameController.resize.call(_this); }, 10);
			});

			// Set the touch events for this new canvas
			this.setTouchEvents();

			// Load in the initial UI elements
			this.loadSide('left');
			this.loadSide('right');

			// Starts up the rendering / drawing
			this.render();

			// pause until a touch event
			if( !this.touches || !this.touches.length ) this.paused = true;
		}
function ( ) { var _this = this ; this . canvas = document . createElement ( 'canvas' ) ; // Scale to same size as original canvas this . resize ( true ) ; document . body . appendChild ( this . canvas ) ; this . ctx = this . canvas . getContext ( '2d' ) ; window . addEventListener ( 'resize' , function ( ) { setTimeout ( function ( ) { GameController . resize . call ( _this ) ; } , 10 ) ; } ) ; // Set the touch events for this new canvas this . setTouchEvents ( ) ; // Load in the initial UI elements this . loadSide ( 'left' ) ; this . loadSide ( 'right' ) ; // Starts up the rendering / drawing this . render ( ) ; // pause until a touch event if ( ! this . touches || ! this . touches . length ) this . paused = true ; }
Creates the canvas that sits on top of the game's canvas and
holds game controls
Creates the canvas that sits on top of the game s canvas and holds game controls