added final results screen
This commit is contained in:
5
game.js
5
game.js
@@ -76,6 +76,10 @@ function gameLoop(){
|
||||
screenReset();
|
||||
runRace(CTX,BG_CTX);
|
||||
break;
|
||||
|
||||
case "finished":
|
||||
CTX.clearRect(0, 0, WIDTH, HEIGHT);
|
||||
drawResults(BG_CTX, WIDTH, HEIGHT, horseHeight, finalPlaces);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -192,6 +196,7 @@ function runRace(ctx,bg_ctx){
|
||||
if (finalPlaces.length === 4){
|
||||
gameState = "finished";
|
||||
stopGallop();
|
||||
playFanfare();
|
||||
}
|
||||
finishLineScan -= finishLineSpeed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user