Kbartawi commited on
Commit
66ca689
·
verified ·
1 Parent(s): a7031c6

Add 2 files

Browse files
Files changed (2) hide show
  1. README.md +7 -5
  2. index.html +512 -19
README.md CHANGED
@@ -1,10 +1,12 @@
1
  ---
2
- title: Stuff
3
- emoji: 📈
4
- colorFrom: green
5
- colorTo: yellow
6
  sdk: static
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
  ---
2
+ title: stuff
3
+ emoji: 🐳
4
+ colorFrom: blue
5
+ colorTo: blue
6
  sdk: static
7
  pinned: false
8
+ tags:
9
+ - deepsite
10
  ---
11
 
12
+ Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
index.html CHANGED
@@ -1,19 +1,512 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Super Mario Bros - HTML5 Clone</title>
7
+ <style>
8
+ body {
9
+ margin: 0;
10
+ padding: 0;
11
+ overflow: hidden;
12
+ background: linear-gradient(to bottom, #1e90ff 0%, #58b7ff 100%);
13
+ font-family: 'Arial', sans-serif;
14
+ touch-action: manipulation;
15
+ }
16
+
17
+ #game-container {
18
+ position: relative;
19
+ width: 100vw;
20
+ height: 100vh;
21
+ overflow: hidden;
22
+ }
23
+
24
+ #game-world {
25
+ position: absolute;
26
+ width: 3000px;
27
+ height: 100vh;
28
+ background-color: #1e90ff;
29
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="20" cy="20" r="5" fill="white" opacity="0.4"/><circle cx="60" cy="35" r="7" fill="white" opacity="0.4"/><circle cx="80" cy="10" r="4" fill="white" opacity="0.4"/></svg>');
30
+ background-size: 100px 100px;
31
+ }
32
+
33
+ #ground {
34
+ position: absolute;
35
+ bottom: 0;
36
+ width: 100%;
37
+ height: 64px;
38
+ background-color: #5c3927;
39
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32"><rect width="32" height="32" fill="%2390562a"/><rect x="0" y="0" width="32" height="8" fill="%23a87842"/><rect x="0" y="8" width="32" height="8" fill="%23604228"/><rect x="0" y="16" width="32" height="8" fill="%23a87842"/><rect x="0" y="24" width="32" height="8" fill="%23604228"/></svg>');
40
+ }
41
+
42
+ #mario {
43
+ position: absolute;
44
+ width: 48px;
45
+ height: 64px;
46
+ bottom: 64px;
47
+ left: 100px;
48
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="64" viewBox="0 0 48 64"><path d="M0,48 L16,48 L16,64 L0,64 Z" fill="%23cc0000"/><path d="M32,48 L48,48 L48,64 L32,64 Z" fill="%23cc0000"/><path d="M8,32 L40,32 L40,48 L8,48 Z" fill="%23f8f808"/><path d="M16,24 L32,24 L32,32 L16,32 Z" fill="%23cc0000"/><path d="M16,16 L32,16 L32,24 L16,24 Z" fill="%23f8f808"/><path d="M8,16 L16,16 L16,24 L8,24 Z" fill="%23f8f808"/><path d="M32,16 L40,16 L40,24 L32,24 Z" fill="%23f8f808"/><path d="M16,8 L32,8 L32,16 L16,16 Z" fill="%23806020"/><circle cx="16" cy="12" r="2" fill="%23000000"/><circle cx="32" cy="12" r="2" fill="%23000000"/><path d="M20,16 L28,16 L28,20 L24,24 L20,20 Z" fill="%23000000"/><path d="M8,4 L40,4 L40,8 L32,8 L32,16 L16,16 L16,8 L8,8 Z" fill="%23806020"/></svg>');
49
+ background-repeat: no-repeat;
50
+ z-index: 10;
51
+ transition: transform 0.05s;
52
+ transform-origin: center bottom;
53
+ image-rendering: pixelated;
54
+ }
55
+
56
+ .mario-walk {
57
+ animation: marioWalk 0.3s steps(3) infinite;
58
+ }
59
+
60
+ @keyframes marioWalk {
61
+ 0% { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="64" viewBox="0 0 48 64"><path d="M0,48 L16,48 L16,64 L0,64 Z" fill="%23cc0000"/><path d="M32,48 L48,48 L48,64 L32,64 Z" fill="%23cc0000"/><path d="M8,32 L40,32 L40,48 L8,48 Z" fill="%23f8f808"/><path d="M16,24 L32,24 L32,32 L16,32 Z" fill="%23cc0000"/><path d="M16,16 L32,16 L32,24 L16,24 Z" fill="%23f8f808"/><path d="M8,16 L16,16 L16,24 L8,24 Z" fill="%23f8f808"/><path d="M32,16 L40,16 L40,24 L32,24 Z" fill="%23f8f808"/><path d="M16,8 L32,8 L32,16 L16,16 Z" fill="%23806020"/><circle cx="16" cy="12" r="2" fill="%23000000"/><circle cx="32" cy="12" r="2" fill="%23000000"/><path d="M20,16 L28,16 L28,20 L24,24 L20,20 Z" fill="%23000000"/><path d="M8,4 L40,4 L40,8 L32,8 L32,16 L16,16 L16,8 L8,8 Z" fill="%23806020"/></svg>'); }
62
+ 33% { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="64" viewBox="0 0 48 64"><path d="M0,48 L16,48 L16,60 L0,60 Z" fill="%23cc0000"/><path d="M32,48 L48,48 L48,64 L32,64 Z" fill="%23cc0000"/><path d="M8,32 L40,32 L40,48 L8,48 Z" fill="%23f8f808"/><path d="M16,24 L32,24 L32,32 L16,32 Z" fill="%23cc0000"/><path d="M16,16 L32,16 L32,24 L16,24 Z" fill="%23f8f808"/><path d="M8,16 L16,16 L16,24 L8,24 Z" fill="%23f8f808"/><path d="M32,16 L40,16 L40,24 L32,24 Z" fill="%23f8f808"/><path d="M16,8 L32,8 L32,16 L16,16 Z" fill="%23806020"/><circle cx="16" cy="12" r="2" fill="%23000000"/><circle cx="32" cy="12" r="2" fill="%23000000"/><path d="M20,16 L28,16 L28,20 L24,24 L20,20 Z" fill="%23000000"/><path d="M8,4 L40,4 L40,8 L32,8 L32,16 L16,16 L16,8 L8,8 Z" fill="%23806020"/></svg>'); }
63
+ 66% { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="64" viewBox="0 0 48 64"><path d="M0,48 L16,48 L16,64 L0,64 Z" fill="%23cc0000"/><path d="M32,48 L48,48 L48,60 L32,60 Z" fill="%23cc0000"/><path d="M8,32 L40,32 L40,48 L8,48 Z" fill="%23f8f808"/><path d="M16,24 L32,24 L32,32 L16,32 Z" fill="%23cc0000"/><path d="M16,16 L32,16 L32,24 L16,24 Z" fill="%23f8f808"/><path d="M8,16 L16,16 L16,24 L8,24 Z" fill="%23f8f808"/><path d="M32,16 L40,16 L40,24 L32,24 Z" fill="%23f8f808"/><path d="M16,8 L32,8 L32,16 L16,16 Z" fill="%23806020"/><circle cx="16" cy="12" r="2" fill="%23000000"/><circle cx="32" cy="12" r="2" fill="%23000000"/><path d="M20,16 L28,16 L28,20 L24,24 L20,20 Z" fill="%23000000"/><path d="M8,4 L40,4 L40,8 L32,8 L32,16 L16,16 L16,8 L8,8 Z" fill="%23806020"/></svg>'); }
64
+ }
65
+
66
+ .mario-jump {
67
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="64" viewBox="0 0 48 64"><path d="M0,48 L16,48 L16,64 L0,64 Z" fill="%23cc0000"/><path d="M32,48 L48,48 L48,64 L32,64 Z" fill="%23cc0000"/><path d="M8,32 L40,32 L40,48 L8,48 Z" fill="%23f8f808"/><path d="M16,24 L32,24 L32,32 L16,32 Z" fill="%23cc0000"/><path d="M16,16 L32,16 L32,24 L16,24 Z" fill="%23f8f808"/><path d="M8,16 L16,16 L16,24 L8,24 Z" fill="%23f8f808"/><path d="M32,16 L40,16 L40,24 L32,24 Z" fill="%23f8f808"/><path d="M16,8 L32,8 L32,16 L16,16 Z" fill="%23806020"/><circle cx="16" cy="12" r="2" fill="%23000000"/><circle cx="32" cy="12" r="2" fill="%23000000"/><path d="M20,16 L28,16 L28,20 L24,24 L20,20 Z" fill="%23000000"/><path d="M8,4 L40,4 L40,8 L32,8 L32,16 L16,16 L16,8 L8,8 Z" fill="%23806020"/></svg>');
68
+ transform: scale(1.2);
69
+ }
70
+
71
+ .block {
72
+ position: absolute;
73
+ width: 48px;
74
+ height: 48px;
75
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><rect width="48" height="48" fill="%23b58c45"/><rect x="4" y="4" width="40" height="40" fill="%23d4a059"/><rect x="8" y="8" width="32" height="32" fill="%23b58c45"/><rect x="12" y="12" width="24" height="24" fill="%23d4a059"/><rect x="16" y="16" width="16" height="16" fill="%23b58c45"/><rect x="20" y="20" width="8" height="8" fill="%23d4a059"/></svg>');
76
+ z-index: 5;
77
+ image-rendering: pixelated;
78
+ }
79
+
80
+ .brick {
81
+ position: absolute;
82
+ width: 48px;
83
+ height: 48px;
84
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><rect width="48" height="48" fill="%23cc0000"/><path d="M0,4 L48,4 L48,8 L0,8 Z M0,12 L48,12 L48,16 L0,16 Z M0,20 L48,20 L48,24 L0,24 Z M0,28 L48,28 L48,32 L0,32 Z M0,36 L48,36 L48,40 L0,40 Z M0,44 L48,44 L48,48 L0,48 Z" fill="%23990000"/></svg>');
85
+ z-index: 5;
86
+ image-rendering: pixelated;
87
+ }
88
+
89
+ .question-block {
90
+ position: absolute;
91
+ width: 48px;
92
+ height: 48px;
93
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><rect width="48" height="48" fill="%23f8d808"/><rect x="4" y="4" width="40" height="40" fill="%23f8f808"/><rect x="8" y="8" width="32" height="32" fill="%23f8d808"/><path d="M24,16 L32,24 L24,32 L16,24 Z" fill="%23f8f808"/></svg>');
94
+ z-index: 5;
95
+ animation: blockBounce 0.5s infinite alternate;
96
+ image-rendering: pixelated;
97
+ }
98
+
99
+ @keyframes blockBounce {
100
+ 0% { transform: translateY(0); }
101
+ 100% { transform: translateY(-3px); }
102
+ }
103
+
104
+ .pipe {
105
+ position: absolute;
106
+ width: 96px;
107
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="96" height="100" viewBox="0 0 96 100"><rect width="96" height="24" fill="%23189409"/><rect y="24" width="96" height="76" fill="%2320b010"/><rect x="8" y="8" width="80" height="16" fill="%2330c020"/><rect x="16" y="28" width="64" height="72" fill="%2330c020"/></svg>');
108
+ background-repeat: repeat-y;
109
+ background-size: 96px 96px;
110
+ z-index: 5;
111
+ image-rendering: pixelated;
112
+ }
113
+
114
+ .coin {
115
+ position: absolute;
116
+ width: 24px;
117
+ height: 24px;
118
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><circle cx="12" cy="12" r="10" fill="%23f8f808" stroke="%23f8d808" stroke-width="2"/><path d="M12,5 C15,5 19,8 19,12 C19,16 15,19 12,19 C9,19 5,16 5,12 C5,8 9,5 12,5 Z" fill="%23e8c810"/><path d="M12,8 C14,8 16,10 16,12 C16,14 14,16 12,16 C10,16 8,14 8,12 C8,10 10,8 12,8 Z" fill="%23f8f808"/></svg>');
119
+ z-index: 4;
120
+ animation: coinSpin 0.5s linear infinite;
121
+ image-rendering: pixelated;
122
+ }
123
+
124
+ @keyframes coinSpin {
125
+ 0% { transform: scale(1) rotateY(0deg); }
126
+ 50% { transform: scale(1.2) rotateY(180deg); }
127
+ 100% { transform: scale(1) rotateY(360deg); }
128
+ }
129
+
130
+ .goomba {
131
+ position: absolute;
132
+ width: 48px;
133
+ height: 45px;
134
+ bottom: 64px;
135
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="45" viewBox="0 0 48 45"><path d="M8,0 C12,0 39,0 40,0 C44,0 48,4 48,8 C48,30 48,30 48,30 C48,38 40,45 40,45 L8,45 C0,45 0,38 0,30 C0,30 0,10 0,8 C0,4 4,0 8,0 Z" fill="%23805c28"/><rect y="15" width="48" height="30" fill="%23684428"/><rect x="6" y="6" width="12" height="9" fill="%23000000"/><rect x="30" y="6" width="12" height="9" fill="%23000000"/><rect x="18" y="24" width="12" height="3" fill="%23000000"/><rect x="12" y="36" width="8" height="9" fill="%23000000"/><rect x="28" y="36" width="8" height="9" fill="%23000000"/></svg>');
136
+ z-index: 6;
137
+ animation: goombaWalk 1s steps(2) infinite;
138
+ image-rendering: pixelated;
139
+ }
140
+
141
+ @keyframes goombaWalk {
142
+ 0% { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="45" viewBox="0 0 48 45"><path d="M8,0 C12,0 39,0 40,0 C44,0 48,4 48,8 C48,30 48,30 48,30 C48,38 40,45 40,45 L8,45 C0,45 0,38 0,30 C0,30 0,10 0,8 C0,4 4,0 8,0 Z" fill="%23805c28"/><rect y="15" width="48" height="30" fill="%23684428"/><rect x="6" y="6" width="12" height="9" fill="%23000000"/><rect x="30" y="6" width="12" height="9" fill="%23000000"/><rect x="18" y="24" width="12" height="3" fill="%23000000"/><rect x="12" y="36" width="8" height="9" fill="%23000000"/><rect x="28" y="36" width="8" height="9" fill="%23000000"/></svg>'); }
143
+ 50% { background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="45" viewBox="0 0 48 45"><path d="M8,0 C12,0 39,0 40,0 C44,0 48,4 48,8 C48,30 48,30 48,30 C48,34 47,38 40,45 L8,45 C5,45 0,40 0,32 C0,32 0,10 0,8 C0,4 4,0 8,0 Z" fill="%23805c28"/><rect y="15" width="48" height="30" fill="%23684428"/><rect x="6" y="6" width="12" height="9" fill="%23000000"/><rect x="30" y="6" width="12" height="9" fill="%23000000"/><rect x="18" y="24" width="12" height="3" fill="%23000000"/><rect x="12" y="36" width="8" height="9" fill="%23000000"/><rect x="28" y="36" width="8" height="9" fill="%23000000"/></svg>'); }
144
+ }
145
+
146
+ .goomba-squashed {
147
+ animation: none;
148
+ height: 20px;
149
+ background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="48" height="20" viewBox="0 0 48 20"><rect y="0" width="48" height="20" fill="%23805c28"/><rect x="18" y="5" width="12" height="3" fill="%23000000"/></svg>');
150
+ }
151
+
152
+ #hud {
153
+ position: fixed;
154
+ top: 10px;
155
+ left: 10px;
156
+ color: white;
157
+ font-size: 24px;
158
+ font-weight: bold;
159
+ text-shadow: 3px 3px 0 #000;
160
+ z-index: 100;
161
+ padding: 10px;
162
+ background-color: rgba(0,0,0,0.5);
163
+ border-radius: 10px;
164
+ display: flex;
165
+ gap: 20px;
166
+ }
167
+
168
+ .hud-item {
169
+ display: flex;
170
+ align-items: center;
171
+ }
172
+
173
+ #controls-info {
174
+ position: fixed;
175
+ bottom: 10px;
176
+ left: 10px;
177
+ color: white;
178
+ font-size: 16px;
179
+ text-shadow: 2px 2px 0 #000;
180
+ background-color: rgba(0,0,0,0.7);
181
+ padding: 10px 15px;
182
+ border-radius: 10px;
183
+ z-index: 100;
184
+ }
185
+
186
+ #game-over {
187
+ position: fixed;
188
+ top: 0;
189
+ left: 0;
190
+ width: 100%;
191
+ height: 100%;
192
+ background-color: rgba(0,0,0,0.8);
193
+ display: none;
194
+ flex-direction: column;
195
+ justify-content: center;
196
+ align-items: center;
197
+ color: white;
198
+ font-size: 48px;
199
+ font-weight: bold;
200
+ text-shadow: 4px 4px 0 #000;
201
+ z-index: 200;
202
+ }
203
+
204
+ #restart-btn {
205
+ margin-top: 30px;
206
+ padding: 15px 30px;
207
+ background-color: #ff0000;
208
+ color: white;
209
+ border: none;
210
+ border-radius: 10px;
211
+ font-size: 24px;
212
+ font-weight: bold;
213
+ cursor: pointer;
214
+ box-shadow: 0 5px 0 #990000, 0 5px 10px rgba(0,0,0,0.5);
215
+ transition: all 0.1s;
216
+ }
217
+
218
+ #restart-btn:active {
219
+ transform: translateY(5px);
220
+ box-shadow: 0 0 0 #990000, 0 5px 10px rgba(0,0,0,0.5);
221
+ }
222
+
223
+ #title {
224
+ position: fixed;
225
+ top: 20px;
226
+ width: 100%;
227
+ text-align: center;
228
+ color: white;
229
+ font-size: 32px;
230
+ font-weight: bold;
231
+ text-shadow: 4px 4px 0 #000;
232
+ z-index: 100;
233
+ animation: titleBounce 1s infinite alternate;
234
+ }
235
+
236
+ @keyframes titleBounce {
237
+ 0% { transform: translateY(0); }
238
+ 100% { transform: translateY(-10px); }
239
+ }
240
+ </style>
241
+ </head>
242
+ <body>
243
+ <div id="title">SUPER MARIO BROS</div>
244
+ <div id="game-container">
245
+ <div id="game-world">
246
+ <div id="ground"></div>
247
+ <div id="mario"></div>
248
+ </div>
249
+ </div>
250
+
251
+ <div id="hud">
252
+ <div class="hud-item">Coins: <span id="coins">0</span></div>
253
+ <div class="hud-item">Score: <span id="score">0</span></div>
254
+ <div class="hud-item">World: <span>1-1</span></div>
255
+ </div>
256
+
257
+ <div id="controls-info">
258
+ ← → to Move | ↑/SPACE to Jump
259
+ </div>
260
+
261
+ <div id="game-over">
262
+ <h1>GAME OVER!</h1>
263
+ <button id="restart-btn">PLAY AGAIN</button>
264
+ </div>
265
+
266
+ <audio id="jump-sound" preload="auto">
267
+ <source src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQ...">
268
+ </audio>
269
+ <audio id="coin-sound" preload="auto">
270
+ <source src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQ...">
271
+ </audio>
272
+ <audio id="bump-sound" preload="auto">
273
+ <source src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQ...">
274
+ </audio>
275
+ <audio id="stomp-sound" preload="auto">
276
+ <source src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQ...">
277
+ </audio>
278
+ <audio id="die-sound" preload="auto">
279
+ <source src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQ...">
280
+ </audio>
281
+ <audio id="theme-music" preload="auto" loop>
282
+ <source src="data:audio/wav;base64,UklGRl9vT19XQVZFZm10IBAAAAABAAEAQB8AAEAfAAABAAgAZGF0YQ...">
283
+ </audio>
284
+
285
+ <script>
286
+ // Game state
287
+ const gameState = {
288
+ coins: 0,
289
+ score: 0,
290
+ lives: 3,
291
+ world: '1-1',
292
+ marioX: 100,
293
+ marioY: 0,
294
+ velocityX: 0,
295
+ velocityY: 0,
296
+ direction: 1, // 1 for right, -1 for left
297
+ isJumping: false,
298
+ isWalking: false,
299
+ isAlive: true,
300
+ cameraX: 0,
301
+ gravity: 0.5,
302
+ jumpForce: -13,
303
+ speed: 5,
304
+ moveAcceleration: 0.7,
305
+ moveDeceleration: 0.7,
306
+ maxSpeed: 8,
307
+ groundY: 0,
308
+ keys: {
309
+ ArrowLeft: false,
310
+ ArrowRight: false,
311
+ ArrowUp: false,
312
+ Space: false,
313
+ KeyA: false,
314
+ KeyD: false,
315
+ KeyW: false
316
+ }
317
+ };
318
+
319
+ // DOM elements
320
+ const gameContainer = document.getElementById('game-container');
321
+ const gameWorld = document.getElementById('game-world');
322
+ const mario = document.getElementById('mario');
323
+ const ground = document.getElementById('ground');
324
+ const coinsDisplay = document.getElementById('coins');
325
+ const scoreDisplay = document.getElementById('score');
326
+ const gameOverScreen = document.getElementById('game-over');
327
+ const restartBtn = document.getElementById('restart-btn');
328
+ const title = document.getElementById('title');
329
+
330
+ // Audio elements
331
+ const jumpSound = document.getElementById('jump-sound');
332
+ const coinSound = document.getElementById('coin-sound');
333
+ const bumpSound = document.getElementById('bump-sound');
334
+ const stompSound = document.getElementById('stomp-sound');
335
+ const dieSound = document.getElementById('die-sound');
336
+ const themeMusic = document.getElementById('theme-music');
337
+
338
+ // Game objects
339
+ const blocks = [];
340
+ const bricks = [];
341
+ const questionBlocks = [];
342
+ const coins = [];
343
+ const pipes = [];
344
+ const goombas = [];
345
+
346
+ // Initialize the game
347
+ function initGame() {
348
+ gameState.coins = 0;
349
+ gameState.score = 0;
350
+ gameState.lives = 3;
351
+ gameState.marioX = 100;
352
+ gameState.marioY = 0;
353
+ gameState.velocityX = 0;
354
+ gameState.velocityY = 0;
355
+ gameState.direction = 1;
356
+ gameState.isJumping = false;
357
+ gameState.isWalking = false;
358
+ gameState.isAlive = true;
359
+ gameState.cameraX = 0;
360
+ gameOverScreen.style.display = 'none';
361
+
362
+ // Reset Mario position and appearance
363
+ mario.style.left = '100px';
364
+ mario.style.bottom = '64px';
365
+ mario.classList.remove('mario-walk', 'mario-jump');
366
+
367
+ // Create level elements
368
+ createLevel();
369
+
370
+ // Start game loop
371
+ requestAnimationFrame(gameLoop);
372
+
373
+ // Play theme music
374
+ themeMusic.currentTime = 0;
375
+ themeMusic.volume = 0.7;
376
+ try {
377
+ themeMusic.play();
378
+ } catch (e) {
379
+ console.log("Audio play failed:", e);
380
+ }
381
+ }
382
+
383
+ // Create level elements
384
+ function createLevel() {
385
+ // Clear existing elements
386
+ gameWorld.querySelectorAll('.block, .brick, .question-block, .coin, .pipe, .goomba')
387
+ .forEach(element => element.remove());
388
+
389
+ // Clear arrays
390
+ blocks.length = 0;
391
+ bricks.length = 0;
392
+ questionBlocks.length = 0;
393
+ coins.length = 0;
394
+ pipes.length = 0;
395
+ goombas.length = 0;
396
+
397
+ // Calculate ground position
398
+ gameState.groundY = 64; // Height of ground element
399
+
400
+ // Add platforms
401
+ for (let i = 0; i < 10; i++) {
402
+ const block = document.createElement('div');
403
+ block.className = 'block';
404
+ block.style.left = (500 + i * 48) + 'px';
405
+ block.style.bottom = '150px';
406
+ gameWorld.appendChild(block);
407
+ blocks.push({
408
+ element: block,
409
+ x: 500 + i * 48,
410
+ y: 150,
411
+ width: 48,
412
+ height: 48
413
+ });
414
+ }
415
+
416
+ // Add bricks
417
+ for (let i = 0; i < 3; i++) {
418
+ const brick = document.createElement('div');
419
+ brick.className = 'brick';
420
+ brick.style.left = (300 + i * 60) + 'px';
421
+ brick.style.bottom = '200px';
422
+ gameWorld.appendChild(brick);
423
+ bricks.push({
424
+ element: brick,
425
+ x: 300 + i * 60,
426
+ y: 200,
427
+ width: 48,
428
+ height: 48
429
+ });
430
+ }
431
+
432
+ // Add question blocks
433
+ for (let i = 0; i < 2; i++) {
434
+ const block = document.createElement('div');
435
+ block.className = 'question-block';
436
+ block.style.left = (700 + i * 120) + 'px';
437
+ block.style.bottom = '200px';
438
+ gameWorld.appendChild(block);
439
+ questionBlocks.push({
440
+ element: block,
441
+ x: 700 + i * 120,
442
+ y: 200,
443
+ width: 48,
444
+ height: 48
445
+ });
446
+ }
447
+
448
+ // Add pipes
449
+ const pipe = document.createElement('div');
450
+ pipe.className = 'pipe';
451
+ pipe.style.left = '1200px';
452
+ pipe.style.bottom = '0px';
453
+ pipe.style.height = '150px';
454
+ gameWorld.appendChild(pipe);
455
+ pipes.push({
456
+ element: pipe,
457
+ x: 1200,
458
+ y: 0,
459
+ width: 96,
460
+ height: 150
461
+ });
462
+
463
+ // Add more pipes
464
+ const pipe2 = document.createElement('div');
465
+ pipe2.className = 'pipe';
466
+ pipe2.style.left = '1800px';
467
+ pipe2.style.bottom = '0px';
468
+ pipe2.style.height = '180px';
469
+ gameWorld.appendChild(pipe2);
470
+ pipes.push({
471
+ element: pipe2,
472
+ x: 1800,
473
+ y: 0,
474
+ width: 96,
475
+ height: 180
476
+ });
477
+
478
+ // Add coins
479
+ for (let i = 0; i < 8; i++) {
480
+ const coin = document.createElement('div');
481
+ coin.className = 'coin';
482
+ coin.style.left = (800 + i * 70) + 'px';
483
+ coin.style.bottom = '250px';
484
+ gameWorld.appendChild(coin);
485
+ coins.push({
486
+ element: coin,
487
+ x: 800 + i * 70,
488
+ y: 250,
489
+ width: 24,
490
+ height: 24
491
+ });
492
+ }
493
+
494
+ // Add floating coins
495
+ for (let i = 0; i < 5; i++) {
496
+ const coin = document.createElement('div');
497
+ coin.className = 'coin';
498
+ coin.style.left = (1500 + i * 150) + 'px';
499
+ coin.style.bottom = '150px';
500
+ gameWorld.appendChild(coin);
501
+ coins.push({
502
+ element: coin,
503
+ x: 1500 + i * 150,
504
+ y: 150,
505
+ width: 24,
506
+ height: 24
507
+ });
508
+ }
509
+
510
+ // Add enemies
511
+ for (let i = 0; i < 5
512
+ </html>