/** * Module that registers spaaaaaaaaace! */ var Space = { SHIP_SPEED: 3, BASE_ASTEROID_DELAY: 500, BASE_ASTEROID_SPEED: 1500, FTB_SPEED: 60000, STAR_WIDTH: 3000, STAR_HEIGHT: 3000, NUM_STARS: 200, STAR_SPEED: 60000, FRAME_DELAY: 100, stars: null, backStars: null, ship: null, lastMove: null, done: false, shipX: null, shipY: null, hull: 0, name: "Space", init: function(options) { this.options = $.extend( this.options, options ); // Create the Space panel this.panel = $('
').attr('id', "spacePanel") .addClass('location') .appendTo('#outerSlider'); // Create the ship Space.ship = $('
').text("@").attr('id', 'ship').appendTo(this.panel); // Create the hull display var h = $('
').attr('id', 'hullRemaining').appendTo(this.panel); $('
').addClass('row_key').text(_('hull: ')).appendTo(h); $('
').addClass('row_val').appendTo(h); //subscribe to stateUpdates $.Dispatch('stateUpdate').subscribe(Space.handleStateUpdates); }, options: {}, // Nothing for now onArrival: function() { Space.done = false; Engine.keyLock = false; Space.hull = Ship.getMaxHull(); Space.altitude = 0; Space.setTitle(); Space.updateHull(); Space.up = Space.down = Space.left = Space.right = false; Space.ship.css({ top: '350px', left: '350px' }); Space.startAscent(); Space._shipTimer = setInterval(Space.moveShip, 33); // APRIL FOOLS! if(document.location.href.search(/[\?\&]april=1/) == -1){ $('body').append($('