2016-11-22 22:48:39 -06:00

27 lines
443 B
JavaScript

//Set the game state
var state = play;
gameLoop();
function gameLoop() {
//Loop this function 60 times per second
requestAnimationFrame(gameLoop);
//Update the current game state:
state();
//Render the stage
renderer.render(stage);
}
function play() {
if(terminalsHacked === 4){
window.location="gameover.html"
}
if(!player.alive()){
setTimeout(function(){
window.location="gameover.html"
}, 1500)
}
}