-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
75 lines (65 loc) · 2.56 KB
/
Copy pathindex.html
File metadata and controls
75 lines (65 loc) · 2.56 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>Snake Game — Onchain Start</title>
<link rel="stylesheet" href="style.css">
<!-- Ethers.js + WalletConnect -->
<script src="https://cdn.jsdelivr.net/npm/ethers@5.7.2/dist/ethers.umd.min.js"></script>
<script src="https://unpkg.com/@walletconnect/web3-provider@1.8.0/dist/umd/index.min.js"></script>
</head>
<body>
<!-- Wallet connect top-left -->
<div class="top-left">
<button id="connectWalletBtn" class="wallet-btn">Connect Wallet</button>
<div id="walletMessage" class="wallet-message">Not connected</div>
</div>
<!-- Game container -->
<div class="game-container">
<div class="title-container">
<img src="logo.png" alt="Logo" class="logo">
<div class="game-title">SNAKE GAME</div>
</div>
<!-- Start -->
<div id="startMenu" class="start-menu">
<button id="startBtn" class="start-btn" disabled>Start Game</button>
<div id="paymentStatus" class="payment-status">Connect your wallet to start</div>
</div>
<!-- Game -->
<div id="gameSection" class="game-section hidden">
<div class="score">Score: <span id="score">0</span></div>
<canvas id="gameCanvas" width="400" height="400"></canvas>
<!-- Arrow controls -->
<div class="controls">
<div class="control-row">
<button class="control-btn" onclick="setDirection('up')">⬆️</button>
</div>
<div class="control-row">
<button class="control-btn" onclick="setDirection('left')">⬅️</button>
<button class="control-btn" onclick="setDirection('down')">⬇️</button>
<button class="control-btn" onclick="setDirection('right')">➡️</button>
</div>
</div>
</div>
<!-- Game over -->
<div class="game-over hidden" id="gameOver">
<h2>Game Over!</h2>
<p>Final Score: <span id="finalScore">0</span></p>
<button onclick="retryGame()" id="retryBtn">Play Again</button>
</div>
<div class="instructions">
<p>Desktop: Use arrow keys | Mobile: Use buttons below</p>
</div>
<!-- Disclaimer -->
<div class="disclaimer">
<p>This game is provided for entertainment purposes only. No rewards, tokens, or incentives are distributed for playing.</p>
</div>
<!-- Footer credit with link -->
<footer class="footer">
<p>Made by <a href="https://x.com/play_crypt" target="_blank">@play_crypt</a></p>
</footer>
</div>
<script src="script.js"></script>
</body>
</html>