-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame.html
More file actions
322 lines (317 loc) · 14.3 KB
/
game.html
File metadata and controls
322 lines (317 loc) · 14.3 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Mysterious Forest</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f0f0f0;
color: #333;
margin: 0;
padding: 20px;
}
#game-area {
background-color: #fff;
padding: 20px;
border-radius: 8px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
max-width: 600px;
margin: 0 auto;
}
#story {
margin-bottom: 20px;
}
#choices {
display: flex;
flex-direction: column;
}
.choice {
margin-bottom: 10px;
padding: 10px;
background-color: #007BFF;
color: #fff;
border: none;
border-radius: 4px;
cursor: pointer;
}
.choice:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div id="game-area">
<div id="story"></div>
<div id="choices"></div>
</div>
<script>
const story = document.getElementById('story');
const choices = document.getElementById('choices');
let currentScene = 0;
const scenes = [
{
text: "You find yourself lost in a mysterious forest. The trees are tall and the path is unclear. You have a backpack with a map, a compass, and a flashlight.",
choices: [
{ text: "Follow the path deeper into the forest.", nextScene: 1 },
{ text: "Try to find a higher ground to get a better view.", nextScene: 2 }
]
},
{
text: "You follow the path deeper into the forest. The trees become denser, and you hear strange noises. Suddenly, you see a glimmer of light in the distance.",
choices: [
{ text: "Investigate the light.", nextScene: 3 },
{ text: "Continue following the path.", nextScene: 4 }
]
},
{
text: "You climb a nearby hill to get a better view. From the top, you see a river flowing through the forest. You also spot a small cabin nearby.",
choices: [
{ text: "Follow the river.", nextScene: 5 },
{ text: "Head towards the cabin.", nextScene: 6 }
]
},
{
text: "You investigate the light and discover it's coming from a campfire. A group of friendly hikers invite you to join them. They offer you food and shelter for the night.",
choices: [
{ text: "Accept their offer.", nextScene: 7 },
{ text: "Politely decline and continue your journey.", nextScene: 8 }
]
},
{
text: "You continue following the path and eventually find a clearing with a small pond. You decide to rest and refill your water bottle.",
choices: [
{ text: "Explore the clearing further.", nextScene: 9 },
{ text: "Return to the path and keep moving.", nextScene: 10 }
]
},
{
text: "You follow the river and discover a hidden waterfall. The sight is breathtaking, and you feel a sense of peace.",
choices: [
{ text: "Take a moment to appreciate the beauty.", nextScene: 11 },
{ text: "Keep moving along the river.", nextScene: 12 }
]
},
{
text: "You head towards the cabin and knock on the door. An old hermit answers and invites you in. He offers you wisdom and a map to help you find your way out of the forest.",
choices: [
{ text: "Accept his help and the map.", nextScene: 13 },
{ text: "Decline and continue on your own.", nextScene: 14 }
]
},
{
text: "You spend the night with the hikers. In the morning, they guide you to the edge of the forest, and you thank them for their kindness.",
choices: [
{ text: "Say your goodbyes and leave.", nextScene: 15 }
]
},
{
text: "You continue your journey alone and eventually find your way out of the forest. You feel a sense of accomplishment and relief.",
choices: [
{ text: "End of the story.", nextScene: 16 }
]
},
{
text: "You explore the clearing and find a hidden path. Following it, you discover a secret grove with ancient ruins.",
choices: [
{ text: "Investigate the ruins.", nextScene: 17 },
{ text: "Leave the grove and return to the main path.", nextScene: 18 }
]
},
{
text: "You keep moving along the river and eventually reach a bridge. Crossing it, you find yourself on a familiar road leading out of the forest.",
choices: [
{ text: "Follow the road to safety.", nextScene: 19 }
]
},
{
text: "You take a moment to appreciate the beauty of the waterfall. As you do, you notice a hidden cave behind the falling water. Curiosity gets the better of you.",
choices: [
{ text: "Enter the cave.", nextScene: 20 },
{ text: "Leave the waterfall and continue your journey.", nextScene: 21 }
]
},
{
text: "You keep moving along the river and eventually reach a bridge. Crossing it, you find yourself on a familiar road leading out of the forest.",
choices: [
{ text: "Follow the road to safety.", nextScene: 22 }
]
},
{
text: "You accept the hermit's help and the map. With his guidance, you navigate your way out of the forest safely.",
choices: [
{ text: "End of the story.", nextScene: 23 }
]
},
{
text: "You decline the hermit's help and continue on your own. After some time, you find your way out of the forest, feeling proud of your determination.",
choices: [
{ text: "End of the story.", nextScene: 24 }
]
},
{
text: "You say your goodbyes to the hikers and leave, feeling grateful for their kindness.",
choices: [
{ text: "End of the story.", nextScene: 25 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 26 }
]
},
{
text: "You investigate the ruins and discover ancient artifacts. You feel a deep connection to the history of the place.",
choices: [
{ text: "Take some artifacts with you.", nextScene: 27 },
{ text: "Leave the artifacts and continue your journey.", nextScene: 28 }
]
},
{
text: "You leave the grove and return to the main path. You continue your journey, feeling a sense of mystery and wonder.",
choices: [
{ text: "Keep moving forward.", nextScene: 29 }
]
},
{
text: "You follow the road to safety and eventually make it out of the forest. You feel a sense of relief and accomplishment.",
choices: [
{ text: "End of the story.", nextScene: 30 }
]
},
{
text: "You enter the cave and discover a hidden treasure. You feel like a true adventurer, having uncovered such a secret.",
choices: [
{ text: "Take the treasure with you.", nextScene: 31 },
{ text: "Leave the treasure and continue your journey.", nextScene: 32 }
]
},
{
text: "You leave the waterfall and continue your journey, feeling inspired by the natural beauty you've witnessed.",
choices: [
{ text: "Keep moving forward.", nextScene: 33 }
]
},
{
text: "You follow the road to safety and eventually make it out of the forest. You feel a sense of relief and accomplishment.",
choices: [
{ text: "End of the story.", nextScene: 34 }
]
},
{
text: "You take some artifacts with you, feeling like a true explorer. You continue your journey, cherishing the memories of your discovery.",
choices: [
{ text: "Keep moving forward.", nextScene: 35 }
]
},
{
text: "You leave the artifacts and continue your journey, feeling a sense of respect for the ancient site.",
choices: [
{ text: "Keep moving forward.", nextScene: 36 }
]
},
{
text: "You take the treasure with you, feeling like a lucky adventurer. You continue your journey, dreaming of the adventures yet to come.",
choices: [
{ text: "Keep moving forward.", nextScene: 37 }
]
},
{
text: "You leave the treasure and continue your journey, feeling content with the experience and the memories you've made.",
choices: [
{ text: "Keep moving forward.", nextScene: 38 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 39 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 40 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 41 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 42 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 43 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 44 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 45 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 46 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 47 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 48 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 49 }
]
},
{
text: "You find your way out of the forest and return home safely. The adventure has taught you valuable lessons about resilience and the beauty of nature.",
choices: [
{ text: "The End.", nextScene: 50 }
]
}
];
function updateStory() {
story.innerHTML = scenes[currentScene].text;
choices.innerHTML = '';
scenes[currentScene].choices.forEach(choice => {
const button = document.createElement('button');
button.className = 'choice';
button.innerText = choice.text;
button.onclick = () => {
currentScene = choice.nextScene;
updateStory();
};
choices.appendChild(button);
});
}
updateStory();
</script>
</body>
</html>