Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Testing new google analytic code.

  • Loading branch information...
commit 3ee683421553f367db8e1227e4df8af72386477d 1 parent 184d75b
@jessefreeman jessefreeman authored
Showing with 1 addition and 1 deletion.
  1. +1 −1  games/resident-raver/game.min.js
View
2  games/resident-raver/game.min.js
@@ -481,7 +481,7 @@ if(ig.input.state('pause')&&!this.isGameOver){if(this.buttonDelayTimer.delta()>t
this.buttonDelayTimer.reset();}}
if(ig.input.state('continue')&&this.isGameOver){this.reloadLevel();}},togglePause:function(){this.paused=!this.paused;if(!this.paused&&this.activeMenu)
this.activeMenu.kill();},displayInstructions:function(value,delay){this.instructionDelay=delay?delay:2;this.instructionsText=value;this.showInstructionText=true;this.instructionsTimer.reset();},draw:function(){this.parent();this.camera.draw();if(this.showStats&&!this.isGameOver){ig.system.context.fillStyle='rgba(0,0,0,0.9)';ig.system.context.fillRect(0*ig.system.scale,0*ig.system.scale,ig.system.width*ig.system.scale,16*ig.system.scale);this.statText.draw("Ammo "+this.stats.ammo.toString().padString(2),5,5);this.statText.draw("Doors "+this.stats.doors.toString().padString(3),50,5);this.statText.draw("Kills "+this.stats.kills.toString().padString(3),105,5);this.statText.draw("Score "+this.stats.score.toString().padString(6),155,5);}
-if(this.showInstructionText){ig.system.context.fillStyle='rgba(0,0,0,0.8)';ig.system.context.fillRect(0*ig.system.scale,(ig.system.height-16)*ig.system.scale,ig.system.width*ig.system.scale,ig.system.height*ig.system.scale);var x=ig.system.width/2,y=ig.system.height-10;this.statText.draw(this.instructionsText,x,y,ig.Font.ALIGN.CENTER);}},gameOver:function(){this.showInstructionText=false;this.isGameOver=true;this.stats.time=Math.round(this.levelTimer.delta());if(this.showStats){this.paused=true;this.activeMenu=this.spawnEntity(EntityGameOverMenu,30,10,this.showStats?{stats:this.stats}:null);this.storage.set("totalScore",this.storage.getInt("totalScore")+this.stats.score);this.storage.set("totalKills",this.storage.getInt("totalKills")+this.stats.kills);this.storage.set("totalDoors",this.storage.getInt("totalDoors")+this.stats.doors);this.tracking.trackPage("/game/over/level/this.currentLevelName");this.tracking.trackEvent("game","over","level:"+this.currentLevelName+",score:"+this.stats.score+",kills"+this.stats.kills+",doors"+this.stats.doors,null);}
+if(this.showInstructionText){ig.system.context.fillStyle='rgba(0,0,0,0.8)';ig.system.context.fillRect(0*ig.system.scale,(ig.system.height-16)*ig.system.scale,ig.system.width*ig.system.scale,ig.system.height*ig.system.scale);var x=ig.system.width/2,y=ig.system.height-10;this.statText.draw(this.instructionsText,x,y,ig.Font.ALIGN.CENTER);}},gameOver:function(){this.showInstructionText=false;this.isGameOver=true;this.stats.time=Math.round(this.levelTimer.delta());if(this.showStats){this.paused=true;this.activeMenu=this.spawnEntity(EntityGameOverMenu,30,10,this.showStats?{stats:this.stats}:null);this.storage.set("totalScore",this.storage.getInt("totalScore")+this.stats.score);this.storage.set("totalKills",this.storage.getInt("totalKills")+this.stats.kills);this.storage.set("totalDoors",this.storage.getInt("totalDoors")+this.stats.doors);this.tracking.trackPage("/game/over/level/"+this.currentLevelName);this.tracking.trackEvent("game","over","level:"+this.currentLevelName+",score:"+this.stats.score+",kills"+this.stats.kills+",doors"+this.stats.doors,null);}
else{this.respawnPlayer();}},reloadLevel:function(){this.isGameOver=false;if(this.paused)
this.togglePause();this.loadLevelDeferred(this.currentLevel);},respawnPlayer:function(){this.player=this.spawnEntity(EntityPlayer,this.playerStartPosition.x,this.playerStartPosition.y);},shakeScreen:function(){if(this.quakeRunning){return;}
this.quakeTimer.set(this.duration);},setDeathMessage:function(value){this.deathMessage=value;}});StartScreen=ig.Game.extend({instructText:new ig.Font('media/04b03.font.png'),background:new ig.Image('media/screen-bg.png'),mainCharacter:new ig.Image('media/screen-main-character.png'),title:new ig.Image('media/game-title.png'),storage:null,startSFX:new ig.Sound('media/sounds/StartGame.*'),tracking:null,init:function(){this.tracking=new Tracking(trackingID);this.storage=new ig.Storage();this.setupLocalStorage();this.tracking.trackPage("/game/new-game-screen");ig.input.bind(ig.KEY.SPACE,'start');},setupLocalStorage:function(){if(!this.storage.isSet("level")){this.storage.set("level",1);this.tracking.trackEvent("game","new","new-install-version:"+version,null);}
Please sign in to comment.
Something went wrong with that request. Please try again.