]> git.eli173.com Git - pong_br/commitdiff
very basic ending text
authorElijah Cohen <eli@eli173.com>
Wed, 8 May 2019 09:09:58 +0000 (04:09 -0500)
committerElijah Cohen <eli@eli173.com>
Wed, 8 May 2019 09:09:58 +0000 (04:09 -0500)
web/draw.js
web/main.js

index 1312ccd0401698ce580984ab8d7789e2e82149f5..0b3ca4d1386e14c0c9e7cb2117c1efdd4c4e29fb 100644 (file)
@@ -110,7 +110,15 @@ var drawLine = function(ctx, color, c1, c2) {
 }
     
 var drawOverlay = function(ctx, place) {
-    
+    ctx.save();
+    //ctx.font = what should it equal? mind sizes on mobile
+    ctx.setTransform(1,0,0,1,0,0);
+    ctx.fillStyle = 'rgba(225,225,225,100)'
+    var string1 = "you placed: " + place;
+    var string2 = "click or press =g= to play again"
+    ctx.fillText(string1, 0, 100);
+    ctx.fillText(string2, 0, 200); // magic number...
+    ctx.restore();
 }
        
 
index 024b6ba3fbe5939c6eb489eb9b564933f3844266..bc021a17a1bd3129bcf371cea4ab8a2b8ab0335b 100644 (file)
@@ -52,6 +52,7 @@ var main = function() { // starts everything, gets us going, setup ish
            if(status) {
                // add event listener if dead
                canvas.onclick = function(e) {location.reload()} // okay, outside of 'input' file...
+               canvas.onkeydown = function(e) {if(e.keyCode == '71') location.reload()};
            }
        }