aboutsummaryrefslogtreecommitdiff
path: root/src/paperflight/static/draw.js
diff options
context:
space:
mode:
authorMark Powers <markppowers0@gmail.com>2020-05-14 10:51:54 -0500
committerMark Powers <markppowers0@gmail.com>2020-05-14 10:51:54 -0500
commit4d3aba7167fbfd5e002714e3c4a577cc17f18af0 (patch)
treedb97fe441f8075e86551c55d20606ff4d958f4a9 /src/paperflight/static/draw.js
parentc5d5990eecd254f3d5daf33a6c9cd394dcba2058 (diff)
Refactor updates, fix gameover, add level changing
Diffstat (limited to 'src/paperflight/static/draw.js')
-rw-r--r--src/paperflight/static/draw.js8
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"