$("#start").on("click",function(){ if(GAME_LOADED) { window.location.reload(); return; } $(this).val("RELOAD"); $(this).blur(); var counts = { "easy": { DRONE: parseInt($("#drones").val()), SPINNER: parseInt($("#spinners").val()), CHASER: parseInt($("#chasers").val()) } } var health = parseInt($("#health").val()); var height = parseInt($("#bHeight").val()); config.update("enemyCounts",counts); config.update("playerHealth",health); config.update("maxBlockHeight",height); $.publish("startGame",config().GAME_MODES.EASY); //self.initNewGame(); });
initNewGame: function(mode) { config.update("maxBlockHeight",config().blockHeightModes[mode]); this.statusBar = new StatusBar(); this.view.hideStartMenu(); this.view.addStatusBar(this.statusBar); _gameMap = new Map(); this.map = _gameMap; proxy.addObject("gameMap",_gameMap); this.createPlayer(); this.createEnemies(mode); this.startGame(); GAME_LOADED = true; $.publish("GameStarted"); },