HTML and CSS Reference
In-Depth Information
score += goalScore;
fillBackground();
setTextStyleTitle();
context.fillText ("YOU WON THE GAME!", 135, 70);
context.fillText ("Final Score: " + score, 150, 100);
context.fillText ("Number of enemy: " + enemyMax, 150,130);
if (score > highScore){
highScore = score;
context.fillText ("NEW HIGH SCORE!", 150,160);
}
context.fillText ("High Score: " + score, 150, 190);
screenStarted = true;
enemyMax++;
if (enemyMax >50){
enemyMax = 50;
}
context.fillText ("Number of enemy for next game: " +
enemyMax, 100,220);
context.fillText ("Press Space To Play", 150, 300);
}else{
//wait for space key click
if (keyPressList[32]==true){
//console.log("space pressed");
switchGameState(GAME_STATE_NEW_GAME);
screenStarted = false;
}
}
}
function gameStatePlayerLose(){
if (!screenStarted){
fillBackground();
setTextStyleTitle();
context.fillText ("SORRY, YOU LOST THE GAME!", 100, 70);
context.fillText ("Final Score: " + score, 150, 100);
context.fillText ("Number of enemy: " + enemyMax, 150,130);
if (score > highScore){
highScore = score;
context.fillText ("NEW HIGH SCORE!", 150,160);
}
context.fillText ("High Score: " + score, 150, 190);
screenStarted = true;
Search WWH ::




Custom Search