added final results screen

This commit is contained in:
2019-07-23 23:52:18 -05:00
parent 587a60d4a0
commit 6342cae167
4 changed files with 107 additions and 24 deletions

View File

@@ -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;
}