Game user interface
To start building our game, we need to prepare our canvas. Our HTML file should look similar to the following:
<html> <head> </head> <body> <canvas id="main_canvas"></canvas> </body> </html>
Our game user interface will be in the <body></body>
tags. We will add JavaScript to our canvas soon.
In the css
folder, create a CSS file named styles.css
, which will contain the following code for our HTML body
, canvas
, and a play button
:
body { position: absolute; top: 0; right: 0; bottom: 0; left: 0; background-color: #ffffff; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; overflow: hidden; } canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; margin: auto; border: 10px solid rgba(63, 72, 204, 0.7); border-radius: 20px; box-shadow: 0 0 500px 100px #ffffff; } button { width: 100%; height...