Write a code to make a snake game in HTML
Answers
Answered by
1
Answer:
To be able to create our game, we have to make use of HTML <canvas> . This is what is used to draw graphics using JavaScript.
Replace the welcome message in snake.html with the following:
<canvas id="gameCanvas" width="300" height="300"><canvas>
The id is what identifies the canvas and should always be specified. We will use it to access the canvas later. The width and height are the dimensions of the canvas, and should also be specified. In this case, 300 x 300 pixels.
If you refresh your browser page where you previously opened snake.html you will now see a blank page. This is because, by default, the canvas is empty and has no background. Lets fix that.
I think this may be help you.
Pls make me brainliest and Pls follow me Pls Pls Pls and I also follow you
Similar questions