diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-05-14 10:51:54 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-05-14 10:51:54 -0500 |
commit | 4d3aba7167fbfd5e002714e3c4a577cc17f18af0 (patch) | |
tree | db97fe441f8075e86551c55d20606ff4d958f4a9 /src/paperflight/static/draw.js | |
parent | c5d5990eecd254f3d5daf33a6c9cd394dcba2058 (diff) |
Refactor updates, fix gameover, add level changing
Diffstat (limited to 'src/paperflight/static/draw.js')
-rw-r--r-- | src/paperflight/static/draw.js | 8 |
1 files changed, 6 insertions, 2 deletions
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" |