From 4d3aba7167fbfd5e002714e3c4a577cc17f18af0 Mon Sep 17 00:00:00 2001 From: Mark Powers Date: Thu, 14 May 2020 10:51:54 -0500 Subject: Refactor updates, fix gameover, add level changing --- src/paperflight/static/draw.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/paperflight/static/draw.js') diff --git a/src/paperflight/static/draw.js b/src/paperflight/static/draw.js index 4646581..5dd919f 100644 --- a/src/paperflight/static/draw.js +++ b/src/paperflight/static/draw.js @@ -9,13 +9,17 @@ function draw() { item.draw() }) drawExit(currLevel.exit) - drawPlane() ctx.fillStyle = "#222" ctx.font = "20px Courier" ctx.fillText(`Level ${currLevelIndex} (${collected}/${currLevel.coinsNeeded}) - ${currLevel.title} - Time ${Math.round(t / fps / 60)}:${Math.round(t / fps) % 60}`, 20, 20) - + + if(gameIsOver){ + ctx.font = "20px Courier" + ctx.fillStyle = "black" + ctx.fillText("Game Over!", 200, 200); + } } function drawPlane() { ctx.fillStyle = "#fff" -- cgit v1.2.3