File size: 1,646 Bytes
e10f93e
2e919f3
e10f93e
2e919f3
 
 
 
 
 
 
9873466
26671c3
2e919f3
 
 
 
 
 
9873466
26671c3
2e919f3
 
 
 
9873466
26671c3
2e919f3
 
 
 
 
 
26671c3
2e919f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88e60fb
e10f93e
7e90688
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE html>
<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>