Spaces:
Running
Running
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Snake Game</title> | |
| <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"> | |
| <style> | |
| body { | |
| background-color: #f0f0f0; | |
| } | |
| .game-container { | |
| width: 80%; | |
| margin: 40px auto; | |
| padding: 20px; | |
| border: 1px solid #ddd; | |
| border-radius: 10px; | |
| box-shadow: 0 0 10px rgba(0, 0, 0, 0.1); | |
| } | |
| .game-board { | |
| width: 400px; | |
| height: 400px; | |
| border: 1px solid #ccc; | |
| background-color: #fff; | |
| } | |
| .snake-body { | |
| width: 20px; | |
| height: 20px; | |
| background-color: #666; | |
| border-radius: 50%; | |
| position: absolute; | |
| } | |
| .food { | |
| width: 20px; | |
| height: 20px; | |
| background-color: #f00; | |
| border-radius: 50%; | |
| position: absolute; | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="game-container"> | |
| <h1>Snake Game</h1> | |
| <div class="game-board" id="game-board"> | |
| <!-- game board will be rendered here --> | |
| </div> | |
| <div class="score-board"> | |
| <p>Score: <span id="score">0</span></p> | |
| </div> | |
| </div> | |
| <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script> | |
| <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script> | |
| <script src="main.js"></script> | |
| </body> | |
| </html> |