diff options
author | Mark Powers <markppowers0@gmail.com> | 2020-05-17 12:32:49 -0500 |
---|---|---|
committer | Mark Powers <markppowers0@gmail.com> | 2020-05-17 12:32:49 -0500 |
commit | b5de6d44e0f291f6fcbe035f4a15edcab1491aad (patch) | |
tree | 258cfeea0e16d7608812e0c75869abcb0a784839 /src/snake/index.html | |
parent | 000b1bcc517891a16bcccc313079c96f214b6f40 (diff) |
Add clickable buttons to snake
Diffstat (limited to 'src/snake/index.html')
-rw-r--r-- | src/snake/index.html | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/src/snake/index.html b/src/snake/index.html index ea982cf..ba1781e 100644 --- a/src/snake/index.html +++ b/src/snake/index.html @@ -5,11 +5,41 @@ <title>Snake</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> - <!-- <link rel="stylesheet" type="text/css" href="/css/styles.css"> --> + <style> + .spacer { + width: 60px; + height: 60px; + display: inline-block; + } + .btn { + width: 60px; + height: 60px; + display: inline-block; + background-color: blue; + } + </style> </head> <body style="padding:0; margin:0; overflow:hidden;"> - <canvas width="400" height="400" id="canvas"></canvas> + <div><canvas width="400" height="400" id="canvas"></canvas></div> + <div > + <span class="spacer"></span> + <span class="spacer"></span> + <span class="btn" onclick="keyPush({keyCode: 38})"></span> + <span class="spacer"></span> + </div> + <div> + <span class="spacer"></span> + <span class="btn" onclick="keyPush({keyCode: 37})"></span> + <span class="spacer"></span> + <span class="btn" onclick="keyPush({keyCode: 39})"></span> + </div> + <div> + <span class="spacer"></span> + <span class="spacer"></span> + <span class="btn" onclick="keyPush({keyCode: 40})"></span> + <span class="spacer"></span> + </div> <script src="/highscore.js"></script> <script> var tileCountWidth = 40; |