terminull-arcade 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -15
- package/dist/{chunk-5CMAXV4B.js → chunk-WCZVPTEK.js} +593 -155
- package/dist/chunk-WCZVPTEK.js.map +1 -0
- package/dist/cli.js +42 -3
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +71 -3
- package/dist/index.js +3 -1
- package/package.json +1 -1
- package/dist/chunk-5CMAXV4B.js.map +0 -1
|
@@ -11,13 +11,13 @@ var ALL_GAMES_METADATA = {
|
|
|
11
11
|
id: "packet-man",
|
|
12
12
|
name: "Packet Man",
|
|
13
13
|
tagline: "Chomp byte pellets and evade rogue memory daemons",
|
|
14
|
-
description: "Classic maze arcade: navigate
|
|
14
|
+
description: "Classic maze arcade: navigate labyrinths, chomp pellets, grab Super Capacitors, and hunt vulnerable daemons.",
|
|
15
15
|
category: "arcade",
|
|
16
16
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
17
17
|
controls: [
|
|
18
|
-
{ key: "Arrow Keys / WASD", action: "
|
|
18
|
+
{ key: "Arrow Keys / WASD", action: "Move Packet Man", description: "Navigate through corridors" },
|
|
19
19
|
{ key: "Esc / P", action: "Pause Menu", description: "Open pause / exit dialog" },
|
|
20
|
-
{ key: "R", action: "Restart Game", description: "Restart
|
|
20
|
+
{ key: "R", action: "Restart Game", description: "Restart round" },
|
|
21
21
|
{ key: "Q", action: "Quit", description: "Return to arcade menu" }
|
|
22
22
|
],
|
|
23
23
|
achievements: [
|
|
@@ -26,18 +26,37 @@ var ALL_GAMES_METADATA = {
|
|
|
26
26
|
{ id: "maze_sweeper", title: "Zero Remaining", description: "Clear an entire memory maze board" }
|
|
27
27
|
]
|
|
28
28
|
},
|
|
29
|
+
"cyber-viper": {
|
|
30
|
+
id: "cyber-viper",
|
|
31
|
+
name: "Cyber Viper",
|
|
32
|
+
tagline: "Slither through the grid, feast on energy apples, avoid your tail",
|
|
33
|
+
description: "The definitive classic snake arcade: grow longer with every bite, snag golden bonus orbs, and test your reflexes.",
|
|
34
|
+
category: "arcade",
|
|
35
|
+
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
36
|
+
controls: [
|
|
37
|
+
{ key: "Arrow Keys / WASD", action: "Steer Viper", description: "Turn direction" },
|
|
38
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause / exit dialog" },
|
|
39
|
+
{ key: "R", action: "Restart", description: "Try again immediately" },
|
|
40
|
+
{ key: "Q", action: "Quit", description: "Return to arcade menu" }
|
|
41
|
+
],
|
|
42
|
+
achievements: [
|
|
43
|
+
{ id: "first_bite", title: "First Crunch", description: "Eat your first energy apple" },
|
|
44
|
+
{ id: "golden_feast", title: "Golden Appetite", description: "Snag a rare golden power orb" },
|
|
45
|
+
{ id: "long_viper", title: "Anaconda Protocol", description: "Reach a snake length of 25 segments" }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
29
48
|
"neon-circuit": {
|
|
30
49
|
id: "neon-circuit",
|
|
31
50
|
name: "Neon Circuit",
|
|
32
|
-
tagline: "Route pure energy through
|
|
33
|
-
description: "
|
|
51
|
+
tagline: "Route pure energy through node grids",
|
|
52
|
+
description: "Pipe puzzle: rotate circuit conduits to bridge power source to target nodes before moves run out.",
|
|
34
53
|
category: "puzzle",
|
|
35
54
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
36
55
|
controls: [
|
|
37
56
|
{ key: "Arrow Keys / WASD", action: "Navigate Grid", description: "Move circuit cursor" },
|
|
38
57
|
{ key: "Space / Enter", action: "Rotate Tile", description: "Rotate wire 90 degrees clockwise" },
|
|
39
58
|
{ key: "R", action: "Reset Grid", description: "Reset puzzle to initial state" },
|
|
40
|
-
{ key: "
|
|
59
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" }
|
|
41
60
|
],
|
|
42
61
|
achievements: [
|
|
43
62
|
{ id: "first_spark", title: "First Spark", description: "Complete your first circuit" },
|
|
@@ -48,15 +67,15 @@ var ALL_GAMES_METADATA = {
|
|
|
48
67
|
"byte-runner": {
|
|
49
68
|
id: "byte-runner",
|
|
50
69
|
name: "Byte Runner",
|
|
51
|
-
tagline: "Sprint down the endless packet highway",
|
|
52
|
-
description: "
|
|
70
|
+
tagline: "Sprint down the endless 3-lane packet highway",
|
|
71
|
+
description: "High-speed lane runner: dodge obstacles, jump over blocks, collect bytes, and grab shields.",
|
|
53
72
|
category: "arcade",
|
|
54
73
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
55
74
|
controls: [
|
|
56
|
-
{ key: "Left / Right / A / D", action: "Change Lane", description: "Shift between
|
|
57
|
-
{ key: "Up / W / Space", action: "Phase Jump", description: "Hop over
|
|
58
|
-
{ key: "Down / S", action: "
|
|
59
|
-
{ key: "
|
|
75
|
+
{ key: "Left / Right / A / D", action: "Change Lane", description: "Shift between 3 lanes" },
|
|
76
|
+
{ key: "Up / W / Space", action: "Phase Jump", description: "Hop over obstacles" },
|
|
77
|
+
{ key: "Down / S", action: "Dive / Slide", description: "Fast drop" },
|
|
78
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" }
|
|
60
79
|
],
|
|
61
80
|
achievements: [
|
|
62
81
|
{ id: "packet_chaser", title: "Packet Chaser", description: "Collect 50 clean byte clusters" },
|
|
@@ -64,193 +83,154 @@ var ALL_GAMES_METADATA = {
|
|
|
64
83
|
{ id: "hyperspeed", title: "Fiber Velocity", description: "Reach a distance score over 5,000" }
|
|
65
84
|
]
|
|
66
85
|
},
|
|
67
|
-
"
|
|
68
|
-
id: "
|
|
69
|
-
name: "
|
|
70
|
-
tagline: "
|
|
71
|
-
description: "
|
|
72
|
-
category: "
|
|
86
|
+
"void-invaders": {
|
|
87
|
+
id: "void-invaders",
|
|
88
|
+
name: "Void Invaders",
|
|
89
|
+
tagline: "Defend orbital defenses against descending alien waves",
|
|
90
|
+
description: "Classic vertical space shooter: maneuver laser gunship, blast invaders, and shoot mystery saucers.",
|
|
91
|
+
category: "arcade",
|
|
73
92
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
74
93
|
controls: [
|
|
75
|
-
{ key: "
|
|
76
|
-
{ key: "
|
|
77
|
-
{ key: "Esc", action: "
|
|
94
|
+
{ key: "Left / Right / A / D", action: "Move Cannon", description: "Slide gunship along bottom" },
|
|
95
|
+
{ key: "Space", action: "Fire Laser", description: "Shoot plasma cannons" },
|
|
96
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" }
|
|
78
97
|
],
|
|
79
98
|
achievements: [
|
|
80
|
-
{ id: "
|
|
81
|
-
{ id: "
|
|
82
|
-
{ id: "
|
|
99
|
+
{ id: "alien_down", title: "First Contact", description: "Destroy your first alien invader" },
|
|
100
|
+
{ id: "mothership_shot", title: "UFO Hunter", description: "Shoot down a high-value red mothership" },
|
|
101
|
+
{ id: "wave_cleared", title: "Sky Guardian", description: "Clear an entire invader armada wave" }
|
|
83
102
|
]
|
|
84
103
|
},
|
|
85
|
-
"
|
|
86
|
-
id: "
|
|
87
|
-
name: "
|
|
88
|
-
tagline: "
|
|
89
|
-
description: "
|
|
90
|
-
category: "
|
|
104
|
+
"bit-breaker": {
|
|
105
|
+
id: "bit-breaker",
|
|
106
|
+
name: "Bit Breaker",
|
|
107
|
+
tagline: "Smash through walls of multi-colored arcade bricks",
|
|
108
|
+
description: "Addictive paddle breakout: angle ricocheting balls, shatter bricks, and unleash multi-ball chaos.",
|
|
109
|
+
category: "arcade",
|
|
91
110
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
92
111
|
controls: [
|
|
93
|
-
{ key: "Left / Right", action: "Move
|
|
94
|
-
{ key: "
|
|
95
|
-
{ key: "
|
|
96
|
-
{ key: "P / Esc", action: "Pause Menu", description: "Open pause dialog" }
|
|
112
|
+
{ key: "Left / Right / A / D", action: "Move Paddle", description: "Control paddle position" },
|
|
113
|
+
{ key: "Space", action: "Launch Ball", description: "Release ball from paddle" },
|
|
114
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" }
|
|
97
115
|
],
|
|
98
116
|
achievements: [
|
|
99
|
-
{ id: "
|
|
100
|
-
{ id: "
|
|
101
|
-
{ id: "
|
|
117
|
+
{ id: "brick_crusher", title: "First Smash", description: "Break 20 arcade bricks" },
|
|
118
|
+
{ id: "paddle_virtuoso", title: "Iron Reflexes", description: "Maintain a 30-hit paddle rally" },
|
|
119
|
+
{ id: "board_clear", title: "Demolition Pro", description: "Clear an entire brick formation" }
|
|
102
120
|
]
|
|
103
121
|
},
|
|
104
|
-
"
|
|
105
|
-
id: "
|
|
106
|
-
name: "
|
|
107
|
-
tagline: "
|
|
108
|
-
description: "
|
|
122
|
+
"stack-tower": {
|
|
123
|
+
id: "stack-tower",
|
|
124
|
+
name: "Stack Tower",
|
|
125
|
+
tagline: "Rotate and drop falling geometric blocks into complete lines",
|
|
126
|
+
description: "The all-time classic block-stacker: clear lines, trigger 4-line combos, and survive speedups.",
|
|
109
127
|
category: "puzzle",
|
|
110
128
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
111
129
|
controls: [
|
|
112
|
-
{ key: "
|
|
113
|
-
{ key: "
|
|
114
|
-
{ key: "
|
|
115
|
-
{ key: "Esc", action: "
|
|
130
|
+
{ key: "Left / Right", action: "Move Block", description: "Shift block horizontally" },
|
|
131
|
+
{ key: "Up / Space", action: "Rotate", description: "Rotate block 90 degrees" },
|
|
132
|
+
{ key: "Down", action: "Soft Drop", description: "Accelerate fall" },
|
|
133
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" }
|
|
116
134
|
],
|
|
117
135
|
achievements: [
|
|
118
|
-
{ id: "
|
|
119
|
-
{ id: "
|
|
120
|
-
{ id: "
|
|
136
|
+
{ id: "line_clear", title: "Single Clear", description: "Clear your first horizontal line" },
|
|
137
|
+
{ id: "quad_clear", title: "Tetra Smash", description: "Clear 4 lines in a single drop" },
|
|
138
|
+
{ id: "tower_master", title: "Block Master", description: "Score over 10,000 points" }
|
|
121
139
|
]
|
|
122
140
|
},
|
|
123
|
-
"
|
|
124
|
-
id: "
|
|
125
|
-
name: "
|
|
126
|
-
tagline: "
|
|
127
|
-
description: "
|
|
128
|
-
category: "
|
|
141
|
+
"data-hopper": {
|
|
142
|
+
id: "data-hopper",
|
|
143
|
+
name: "Data Hopper",
|
|
144
|
+
tagline: "Hop across busy highways and rushing rivers",
|
|
145
|
+
description: "Frogger-style road crosser: dodge speeding traffic, leap onto floating logs, and reach home safely.",
|
|
146
|
+
category: "arcade",
|
|
129
147
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
130
148
|
controls: [
|
|
131
|
-
{ key: "Arrow Keys", action: "
|
|
132
|
-
{ key: "P", action: "
|
|
133
|
-
{ key: "
|
|
134
|
-
{ key: "
|
|
149
|
+
{ key: "Arrow Keys / WASD", action: "Hop Direction", description: "Leap one grid tile" },
|
|
150
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" },
|
|
151
|
+
{ key: "R", action: "Restart Hop", description: "Restart crossing" },
|
|
152
|
+
{ key: "Q", action: "Quit", description: "Return to arcade menu" }
|
|
135
153
|
],
|
|
136
154
|
achievements: [
|
|
137
|
-
{ id: "
|
|
138
|
-
{ id: "
|
|
139
|
-
{ id: "
|
|
155
|
+
{ id: "safe_crossing", title: "First Crossing", description: "Deliver a hopper safely home" },
|
|
156
|
+
{ id: "traffic_dodger", title: "Speedy Legs", description: "Cross the highway without stopping" },
|
|
157
|
+
{ id: "all_home", title: "Family Reunion", description: "Fill all 5 home bases" }
|
|
140
158
|
]
|
|
141
159
|
},
|
|
142
|
-
"
|
|
143
|
-
id: "
|
|
144
|
-
name: "
|
|
145
|
-
tagline: "
|
|
146
|
-
description: "
|
|
147
|
-
category: "
|
|
160
|
+
"flappy-byte": {
|
|
161
|
+
id: "flappy-byte",
|
|
162
|
+
name: "Flappy Byte",
|
|
163
|
+
tagline: "Tap to flap through narrow pipe gaps",
|
|
164
|
+
description: "Fast-paced flapping arcade: maintain altitude, navigate pipe gates, and chase high score streaks.",
|
|
165
|
+
category: "arcade",
|
|
148
166
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
149
167
|
controls: [
|
|
150
|
-
{ key: "
|
|
151
|
-
{ key: "
|
|
152
|
-
{ key: "
|
|
153
|
-
{ key: "
|
|
168
|
+
{ key: "Space / Up", action: "Flap Wings", description: "Thrust upward against gravity" },
|
|
169
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" },
|
|
170
|
+
{ key: "R", action: "Restart Flight", description: "Try again immediately" },
|
|
171
|
+
{ key: "Q", action: "Quit", description: "Return to arcade menu" }
|
|
154
172
|
],
|
|
155
173
|
achievements: [
|
|
156
|
-
{ id: "
|
|
157
|
-
{ id: "
|
|
158
|
-
{ id: "
|
|
174
|
+
{ id: "first_pipe", title: "First Flight", description: "Pass your first obstacle pipe" },
|
|
175
|
+
{ id: "bronze_flyer", title: "Bronze Aviator", description: "Score 10 consecutive gates" },
|
|
176
|
+
{ id: "silver_flyer", title: "Silver Aviator", description: "Score 25 consecutive gates" }
|
|
159
177
|
]
|
|
160
178
|
},
|
|
161
|
-
"
|
|
162
|
-
id: "
|
|
163
|
-
name: "
|
|
164
|
-
tagline: "
|
|
165
|
-
description: "
|
|
166
|
-
category: "
|
|
179
|
+
"cyber-pong": {
|
|
180
|
+
id: "cyber-pong",
|
|
181
|
+
name: "Cyber Pong",
|
|
182
|
+
tagline: "High-speed tennis rally against smart AI opponent",
|
|
183
|
+
description: "The quintessential arcade rally: deflection angles, spin shots, and first to 7 points takes victory.",
|
|
184
|
+
category: "arcade",
|
|
167
185
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
168
186
|
controls: [
|
|
169
|
-
{ key: "
|
|
170
|
-
{ key: "
|
|
171
|
-
{ key: "
|
|
172
|
-
{ key: "
|
|
187
|
+
{ key: "Up / Down / W / S", action: "Move Paddle", description: "Adjust paddle height" },
|
|
188
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" },
|
|
189
|
+
{ key: "R", action: "Restart Match", description: "New set" },
|
|
190
|
+
{ key: "Q", action: "Quit", description: "Return to arcade menu" }
|
|
173
191
|
],
|
|
174
192
|
achievements: [
|
|
175
|
-
{ id: "
|
|
176
|
-
{ id: "
|
|
177
|
-
{ id: "
|
|
193
|
+
{ id: "first_point", title: "First Serve", description: "Score a point against opponent" },
|
|
194
|
+
{ id: "shutout", title: "Flawless Set", description: "Win a match without conceding a point" },
|
|
195
|
+
{ id: "rally_champion", title: "Table Sovereign", description: "Win on insane difficulty" }
|
|
178
196
|
]
|
|
179
197
|
},
|
|
180
|
-
"
|
|
181
|
-
id: "
|
|
182
|
-
name: "
|
|
183
|
-
tagline: "
|
|
184
|
-
description: "
|
|
198
|
+
"meteor-drift": {
|
|
199
|
+
id: "meteor-drift",
|
|
200
|
+
name: "Meteor Drift",
|
|
201
|
+
tagline: "Thrust, rotate, and blast space rocks into dust",
|
|
202
|
+
description: "Asteroids-style space drift: 360-degree rotation, momentum thrust physics, and asteroid splitting.",
|
|
185
203
|
category: "arcade",
|
|
186
204
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
187
205
|
controls: [
|
|
188
|
-
{ key: "
|
|
189
|
-
{ key: "
|
|
190
|
-
{ key: "
|
|
191
|
-
{ key: "
|
|
206
|
+
{ key: "Left / Right", action: "Rotate Ship", description: "Turn ship heading" },
|
|
207
|
+
{ key: "Up / W", action: "Thrust Engine", description: "Accelerate forward" },
|
|
208
|
+
{ key: "Space", action: "Fire Cannons", description: "Blast space rocks" },
|
|
209
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" }
|
|
192
210
|
],
|
|
193
211
|
achievements: [
|
|
194
|
-
{ id: "
|
|
195
|
-
{ id: "
|
|
196
|
-
{ id: "
|
|
212
|
+
{ id: "rock_smasher", title: "First Stardust", description: "Break your first giant asteroid" },
|
|
213
|
+
{ id: "drift_king", title: "Inertia Master", description: "Destroy 10 rocks while coasting" },
|
|
214
|
+
{ id: "sector_clear", title: "Cosmic Ace", description: "Survive 3 asteroid waves" }
|
|
197
215
|
]
|
|
198
216
|
},
|
|
199
|
-
"
|
|
200
|
-
id: "
|
|
201
|
-
name: "
|
|
202
|
-
tagline: "
|
|
203
|
-
description: "
|
|
217
|
+
"core-defuser": {
|
|
218
|
+
id: "core-defuser",
|
|
219
|
+
name: "Core Defuser",
|
|
220
|
+
tagline: "Uncover safe tiles and flag hidden mines",
|
|
221
|
+
description: "Classic minesweeper logic: reveal numbers, deduce danger zones, and flag every hidden explosive.",
|
|
204
222
|
category: "puzzle",
|
|
205
223
|
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
206
224
|
controls: [
|
|
207
|
-
{ key: "
|
|
208
|
-
{ key: "Space", action: "
|
|
209
|
-
{ key: "
|
|
210
|
-
{ key: "
|
|
211
|
-
],
|
|
212
|
-
achievements: [
|
|
213
|
-
{ id: "perfect_recall", title: "Synaptic Link", description: "Reach sequence level 10" },
|
|
214
|
-
{ id: "daily_champ", title: "Daily Chronicler", description: "Conquer the daily matrix seed" },
|
|
215
|
-
{ id: "coop_harmony", title: "Twin Processors", description: "Complete a round in co-op mode" }
|
|
216
|
-
]
|
|
217
|
-
},
|
|
218
|
-
"space-salvage": {
|
|
219
|
-
id: "space-salvage",
|
|
220
|
-
name: "Space Salvage",
|
|
221
|
-
tagline: "Command derelict recovery in orbital graveyards",
|
|
222
|
-
description: "Strategic roguelite: balance crew oxygen, thermal levels, salvage weight, and rogue defense drones.",
|
|
223
|
-
category: "strategy",
|
|
224
|
-
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
225
|
-
controls: [
|
|
226
|
-
{ key: "1-5", action: "Order Crew", description: "Dispatch scavengers to bulkheads" },
|
|
227
|
-
{ key: "Space", action: "Next Turn", description: "Advance exploration tick" },
|
|
228
|
-
{ key: "J", action: "Jettison Cargo", description: "Lighten load for emergency thrusters" },
|
|
229
|
-
{ key: "Esc", action: "Status HUD", description: "Inspect ship schematics" }
|
|
225
|
+
{ key: "Arrow Keys / WASD", action: "Move Pointer", description: "Inspect grid cells" },
|
|
226
|
+
{ key: "Space", action: "Reveal Cell", description: "Uncover target cell" },
|
|
227
|
+
{ key: "F", action: "Flag Mine", description: "Mark dangerous tile" },
|
|
228
|
+
{ key: "Esc / P", action: "Pause Menu", description: "Open pause dialog" }
|
|
230
229
|
],
|
|
231
230
|
achievements: [
|
|
232
|
-
{ id: "
|
|
233
|
-
{ id: "
|
|
234
|
-
{ id: "
|
|
235
|
-
]
|
|
236
|
-
},
|
|
237
|
-
"shell-quest": {
|
|
238
|
-
id: "shell-quest",
|
|
239
|
-
name: "Shell Quest",
|
|
240
|
-
tagline: "Master unix arcana across the command realm",
|
|
241
|
-
description: "Terminal RPG: wield grep, awk, git, and pipelines to overcome daemon bosses in simulated root.",
|
|
242
|
-
category: "educational",
|
|
243
|
-
difficultyLevels: ["easy", "normal", "hard", "insane"],
|
|
244
|
-
controls: [
|
|
245
|
-
{ key: "Input Line", action: "Type Shell Cmd", description: "Issue commands to bash interface" },
|
|
246
|
-
{ key: "Tab", action: "Autocomplete", description: "Complete paths and binaries" },
|
|
247
|
-
{ key: "Ctrl+L", action: "Clear Screen", description: "Clear adventure log output" },
|
|
248
|
-
{ key: "Esc / :q", action: "Exit Quest", description: "Return to portal" }
|
|
249
|
-
],
|
|
250
|
-
achievements: [
|
|
251
|
-
{ id: "sudo_apprentice", title: "UID Zero", description: "Attain root privileges in Area 1" },
|
|
252
|
-
{ id: "pipe_master", title: "Pipe Virtuoso", description: "Chasm puzzle cleared with 3+ pipes" },
|
|
253
|
-
{ id: "git_guru", title: "Rebase Conqueror", description: "Resolve the detached HEAD calamity" }
|
|
231
|
+
{ id: "safe_step", title: "First Discovery", description: "Reveal a cell with zero casualties" },
|
|
232
|
+
{ id: "flag_master", title: "EOD Technician", description: "Flag 5 real mines correctly" },
|
|
233
|
+
{ id: "grid_defused", title: "Bomb Squad Master", description: "Complete a minefield without detonation" }
|
|
254
234
|
]
|
|
255
235
|
}
|
|
256
236
|
};
|
|
@@ -549,10 +529,12 @@ var TerminalRenderer = class {
|
|
|
549
529
|
getTheme() {
|
|
550
530
|
return this.currentTheme;
|
|
551
531
|
}
|
|
532
|
+
previousLineCount = 0;
|
|
552
533
|
enterScreen() {
|
|
553
534
|
if (!this.inAltBuffer && process.stdout.isTTY) {
|
|
554
535
|
process.stdout.write("\x1B[?1049h\x1B[?25l\x1B[2J\x1B[H");
|
|
555
536
|
this.inAltBuffer = true;
|
|
537
|
+
this.previousLineCount = 0;
|
|
556
538
|
}
|
|
557
539
|
}
|
|
558
540
|
exitScreen() {
|
|
@@ -561,14 +543,45 @@ var TerminalRenderer = class {
|
|
|
561
543
|
this.inAltBuffer = false;
|
|
562
544
|
}
|
|
563
545
|
}
|
|
546
|
+
/**
|
|
547
|
+
* Safe frame render with zero flickering.
|
|
548
|
+
* Repaints lines in place with cursor hidden and atomic buffer write,
|
|
549
|
+
* avoiding full-screen blanking clears.
|
|
550
|
+
*/
|
|
551
|
+
renderFrame(content) {
|
|
552
|
+
if (!process.stdout.isTTY) return;
|
|
553
|
+
const lines = content.split("\n");
|
|
554
|
+
let output = "\x1B[?25l\x1B[H";
|
|
555
|
+
for (let i = 0; i < lines.length; i++) {
|
|
556
|
+
output += `${lines[i]}\x1B[K
|
|
557
|
+
`;
|
|
558
|
+
}
|
|
559
|
+
if (lines.length < this.previousLineCount) {
|
|
560
|
+
output += "\x1B[J";
|
|
561
|
+
}
|
|
562
|
+
this.previousLineCount = lines.length;
|
|
563
|
+
process.stdout.write(output);
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Retained for compatibility. Forwards to flicker-free renderFrame.
|
|
567
|
+
*/
|
|
568
|
+
draw(content) {
|
|
569
|
+
this.renderFrame(content);
|
|
570
|
+
}
|
|
571
|
+
/**
|
|
572
|
+
* Intentionally no-op during active game loop to prevent blank-frame visual strobing.
|
|
573
|
+
*/
|
|
564
574
|
clear() {
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Explicit full screen wipe when transitioning between major modes.
|
|
578
|
+
*/
|
|
579
|
+
forceClear() {
|
|
565
580
|
if (process.stdout.isTTY) {
|
|
566
581
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
582
|
+
this.previousLineCount = 0;
|
|
567
583
|
}
|
|
568
584
|
}
|
|
569
|
-
draw(content) {
|
|
570
|
-
process.stdout.write(`\x1B[H${content}`);
|
|
571
|
-
}
|
|
572
585
|
isWindowAdequate() {
|
|
573
586
|
const width = process.stdout.columns || 80;
|
|
574
587
|
const height = process.stdout.rows || 24;
|
|
@@ -2822,6 +2835,430 @@ ${boardLines.join("\n")}
|
|
|
2822
2835
|
}
|
|
2823
2836
|
};
|
|
2824
2837
|
|
|
2838
|
+
// src/games/cyber-viper/index.ts
|
|
2839
|
+
var GRID_WIDTH = 30;
|
|
2840
|
+
var GRID_HEIGHT = 16;
|
|
2841
|
+
var CyberViperGame = class {
|
|
2842
|
+
id = "cyber-viper";
|
|
2843
|
+
metadata = ALL_GAMES_METADATA["cyber-viper"];
|
|
2844
|
+
config = null;
|
|
2845
|
+
renderer = defaultRenderer;
|
|
2846
|
+
input = new TerminalInputHandler();
|
|
2847
|
+
rng = new DeterministicRNG();
|
|
2848
|
+
gameLoopTimer = null;
|
|
2849
|
+
state = {
|
|
2850
|
+
snake: [
|
|
2851
|
+
{ x: 15, y: 8 },
|
|
2852
|
+
{ x: 14, y: 8 },
|
|
2853
|
+
{ x: 13, y: 8 }
|
|
2854
|
+
],
|
|
2855
|
+
dx: 1,
|
|
2856
|
+
dy: 0,
|
|
2857
|
+
desiredDx: 1,
|
|
2858
|
+
desiredDy: 0,
|
|
2859
|
+
food: { x: 22, y: 8 },
|
|
2860
|
+
goldenFood: null,
|
|
2861
|
+
goldenFoodTicks: 0,
|
|
2862
|
+
score: 0,
|
|
2863
|
+
highScore: 0,
|
|
2864
|
+
applesEaten: 0,
|
|
2865
|
+
isGameOver: false,
|
|
2866
|
+
isWon: false
|
|
2867
|
+
};
|
|
2868
|
+
isPaused = false;
|
|
2869
|
+
pauseMenuIndex = 0;
|
|
2870
|
+
showTutorial = true;
|
|
2871
|
+
tickIntervalMs = 120;
|
|
2872
|
+
init(config) {
|
|
2873
|
+
this.config = config;
|
|
2874
|
+
this.renderer.setTheme(config.theme);
|
|
2875
|
+
this.rng = new DeterministicRNG(config.seed || Date.now());
|
|
2876
|
+
if (config.skipTutorial !== void 0) {
|
|
2877
|
+
this.showTutorial = !config.skipTutorial;
|
|
2878
|
+
}
|
|
2879
|
+
this.resetState(config.difficulty);
|
|
2880
|
+
}
|
|
2881
|
+
start() {
|
|
2882
|
+
this.isPaused = false;
|
|
2883
|
+
this.render();
|
|
2884
|
+
this.input.start(
|
|
2885
|
+
(key) => this.handleInput(key),
|
|
2886
|
+
() => {
|
|
2887
|
+
this.destroy();
|
|
2888
|
+
process.exit(0);
|
|
2889
|
+
}
|
|
2890
|
+
);
|
|
2891
|
+
this.scheduleNextTick();
|
|
2892
|
+
}
|
|
2893
|
+
pause() {
|
|
2894
|
+
this.isPaused = true;
|
|
2895
|
+
if (this.gameLoopTimer) {
|
|
2896
|
+
clearTimeout(this.gameLoopTimer);
|
|
2897
|
+
this.gameLoopTimer = null;
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
resume() {
|
|
2901
|
+
this.isPaused = false;
|
|
2902
|
+
this.scheduleNextTick();
|
|
2903
|
+
this.render();
|
|
2904
|
+
}
|
|
2905
|
+
restart() {
|
|
2906
|
+
if (this.config) {
|
|
2907
|
+
this.resetState(this.config.difficulty);
|
|
2908
|
+
this.scheduleNextTick();
|
|
2909
|
+
this.render();
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
saveState() {
|
|
2913
|
+
return {
|
|
2914
|
+
state: this.state,
|
|
2915
|
+
showTutorial: this.showTutorial
|
|
2916
|
+
};
|
|
2917
|
+
}
|
|
2918
|
+
loadState(saved) {
|
|
2919
|
+
if (saved["state"]) this.state = saved["state"];
|
|
2920
|
+
if (saved["showTutorial"] !== void 0) this.showTutorial = !!saved["showTutorial"];
|
|
2921
|
+
}
|
|
2922
|
+
destroy() {
|
|
2923
|
+
if (this.gameLoopTimer) {
|
|
2924
|
+
clearTimeout(this.gameLoopTimer);
|
|
2925
|
+
this.gameLoopTimer = null;
|
|
2926
|
+
}
|
|
2927
|
+
this.input.stop();
|
|
2928
|
+
}
|
|
2929
|
+
resetState(difficulty) {
|
|
2930
|
+
switch (difficulty) {
|
|
2931
|
+
case "easy":
|
|
2932
|
+
this.tickIntervalMs = 160;
|
|
2933
|
+
break;
|
|
2934
|
+
case "normal":
|
|
2935
|
+
this.tickIntervalMs = 120;
|
|
2936
|
+
break;
|
|
2937
|
+
case "hard":
|
|
2938
|
+
this.tickIntervalMs = 85;
|
|
2939
|
+
break;
|
|
2940
|
+
case "insane":
|
|
2941
|
+
this.tickIntervalMs = 55;
|
|
2942
|
+
break;
|
|
2943
|
+
}
|
|
2944
|
+
this.state = {
|
|
2945
|
+
snake: [
|
|
2946
|
+
{ x: 15, y: 8 },
|
|
2947
|
+
{ x: 14, y: 8 },
|
|
2948
|
+
{ x: 13, y: 8 }
|
|
2949
|
+
],
|
|
2950
|
+
dx: 1,
|
|
2951
|
+
dy: 0,
|
|
2952
|
+
desiredDx: 1,
|
|
2953
|
+
desiredDy: 0,
|
|
2954
|
+
food: { x: 22, y: 8 },
|
|
2955
|
+
goldenFood: null,
|
|
2956
|
+
goldenFoodTicks: 0,
|
|
2957
|
+
score: 0,
|
|
2958
|
+
highScore: this.state.highScore,
|
|
2959
|
+
applesEaten: 0,
|
|
2960
|
+
isGameOver: false,
|
|
2961
|
+
isWon: false
|
|
2962
|
+
};
|
|
2963
|
+
this.spawnFood();
|
|
2964
|
+
}
|
|
2965
|
+
scheduleNextTick() {
|
|
2966
|
+
if (this.gameLoopTimer) clearTimeout(this.gameLoopTimer);
|
|
2967
|
+
if (this.isPaused || this.state.isGameOver || this.state.isWon || this.showTutorial) return;
|
|
2968
|
+
this.gameLoopTimer = setTimeout(() => {
|
|
2969
|
+
this.tick();
|
|
2970
|
+
this.scheduleNextTick();
|
|
2971
|
+
}, this.tickIntervalMs);
|
|
2972
|
+
}
|
|
2973
|
+
tick() {
|
|
2974
|
+
if (this.state.isGameOver || this.state.isWon || this.isPaused || this.showTutorial) return;
|
|
2975
|
+
if (this.state.desiredDx !== -this.state.dx || this.state.desiredDy !== -this.state.dy) {
|
|
2976
|
+
this.state.dx = this.state.desiredDx;
|
|
2977
|
+
this.state.dy = this.state.desiredDy;
|
|
2978
|
+
}
|
|
2979
|
+
const head = this.state.snake[0];
|
|
2980
|
+
const newHead = {
|
|
2981
|
+
x: head.x + this.state.dx,
|
|
2982
|
+
y: head.y + this.state.dy
|
|
2983
|
+
};
|
|
2984
|
+
if (newHead.x < 0 || newHead.x >= GRID_WIDTH || newHead.y < 0 || newHead.y >= GRID_HEIGHT) {
|
|
2985
|
+
this.state.isGameOver = true;
|
|
2986
|
+
this.config?.onGameOver?.(this.state.score);
|
|
2987
|
+
if (this.config?.soundEnabled) playTerminalBell();
|
|
2988
|
+
this.render();
|
|
2989
|
+
return;
|
|
2990
|
+
}
|
|
2991
|
+
for (let i = 0; i < this.state.snake.length - 1; i++) {
|
|
2992
|
+
const seg = this.state.snake[i];
|
|
2993
|
+
if (seg.x === newHead.x && seg.y === newHead.y) {
|
|
2994
|
+
this.state.isGameOver = true;
|
|
2995
|
+
this.config?.onGameOver?.(this.state.score);
|
|
2996
|
+
if (this.config?.soundEnabled) playTerminalBell();
|
|
2997
|
+
this.render();
|
|
2998
|
+
return;
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
this.state.snake.unshift(newHead);
|
|
3002
|
+
if (this.state.goldenFoodTicks > 0) {
|
|
3003
|
+
this.state.goldenFoodTicks--;
|
|
3004
|
+
if (this.state.goldenFoodTicks === 0) {
|
|
3005
|
+
this.state.goldenFood = null;
|
|
3006
|
+
}
|
|
3007
|
+
}
|
|
3008
|
+
let grew = false;
|
|
3009
|
+
if (newHead.x === this.state.food.x && newHead.y === this.state.food.y) {
|
|
3010
|
+
grew = true;
|
|
3011
|
+
this.state.score += 100;
|
|
3012
|
+
this.state.applesEaten++;
|
|
3013
|
+
this.config?.onScoreUpdate?.(this.state.score);
|
|
3014
|
+
this.config?.onAchievementUnlock?.("first_bite");
|
|
3015
|
+
if (this.state.snake.length >= 25) {
|
|
3016
|
+
this.config?.onAchievementUnlock?.("long_viper");
|
|
3017
|
+
}
|
|
3018
|
+
if (this.config?.soundEnabled) playTerminalBell();
|
|
3019
|
+
this.spawnFood();
|
|
3020
|
+
if (this.rng.next() < 0.25 && !this.state.goldenFood) {
|
|
3021
|
+
this.spawnGoldenFood();
|
|
3022
|
+
}
|
|
3023
|
+
} else if (this.state.goldenFood && newHead.x === this.state.goldenFood.x && newHead.y === this.state.goldenFood.y) {
|
|
3024
|
+
grew = true;
|
|
3025
|
+
this.state.score += 500;
|
|
3026
|
+
this.state.goldenFood = null;
|
|
3027
|
+
this.state.goldenFoodTicks = 0;
|
|
3028
|
+
this.config?.onScoreUpdate?.(this.state.score);
|
|
3029
|
+
this.config?.onAchievementUnlock?.("golden_feast");
|
|
3030
|
+
if (this.config?.soundEnabled) playTerminalBell();
|
|
3031
|
+
}
|
|
3032
|
+
if (!grew) {
|
|
3033
|
+
this.state.snake.pop();
|
|
3034
|
+
}
|
|
3035
|
+
this.render();
|
|
3036
|
+
}
|
|
3037
|
+
spawnFood() {
|
|
3038
|
+
const emptyCells = [];
|
|
3039
|
+
for (let y = 0; y < GRID_HEIGHT; y++) {
|
|
3040
|
+
for (let x = 0; x < GRID_WIDTH; x++) {
|
|
3041
|
+
if (!this.state.snake.some((s) => s.x === x && s.y === y)) {
|
|
3042
|
+
emptyCells.push({ x, y });
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
if (emptyCells.length > 0) {
|
|
3047
|
+
this.state.food = this.rng.pick(emptyCells);
|
|
3048
|
+
} else {
|
|
3049
|
+
this.state.isWon = true;
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
spawnGoldenFood() {
|
|
3053
|
+
const emptyCells = [];
|
|
3054
|
+
for (let y = 0; y < GRID_HEIGHT; y++) {
|
|
3055
|
+
for (let x = 0; x < GRID_WIDTH; x++) {
|
|
3056
|
+
if (!this.state.snake.some((s) => s.x === x && s.y === y) && (x !== this.state.food.x || y !== this.state.food.y)) {
|
|
3057
|
+
emptyCells.push({ x, y });
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
}
|
|
3061
|
+
if (emptyCells.length > 0) {
|
|
3062
|
+
this.state.goldenFood = this.rng.pick(emptyCells);
|
|
3063
|
+
this.state.goldenFoodTicks = 70;
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
handleInput(key) {
|
|
3067
|
+
if (this.showTutorial) {
|
|
3068
|
+
if (key.name === "return" || key.name === "space") {
|
|
3069
|
+
this.showTutorial = false;
|
|
3070
|
+
this.scheduleNextTick();
|
|
3071
|
+
this.render();
|
|
3072
|
+
} else if (key.name === "escape" || key.name === "q") {
|
|
3073
|
+
this.destroy();
|
|
3074
|
+
this.config?.onExit?.();
|
|
3075
|
+
}
|
|
3076
|
+
return;
|
|
3077
|
+
}
|
|
3078
|
+
if (this.isPaused) {
|
|
3079
|
+
if (key.name === "up" || key.name === "w") {
|
|
3080
|
+
this.pauseMenuIndex = (this.pauseMenuIndex - 1 + 3) % 3;
|
|
3081
|
+
this.render();
|
|
3082
|
+
} else if (key.name === "down" || key.name === "s") {
|
|
3083
|
+
this.pauseMenuIndex = (this.pauseMenuIndex + 1) % 3;
|
|
3084
|
+
this.render();
|
|
3085
|
+
} else if (key.name === "return" || key.name === "space") {
|
|
3086
|
+
if (this.pauseMenuIndex === 0) {
|
|
3087
|
+
this.isPaused = false;
|
|
3088
|
+
this.scheduleNextTick();
|
|
3089
|
+
this.render();
|
|
3090
|
+
} else if (this.pauseMenuIndex === 1) {
|
|
3091
|
+
this.isPaused = false;
|
|
3092
|
+
this.resetState(this.config?.difficulty || "normal");
|
|
3093
|
+
this.scheduleNextTick();
|
|
3094
|
+
this.render();
|
|
3095
|
+
} else if (this.pauseMenuIndex === 2) {
|
|
3096
|
+
this.destroy();
|
|
3097
|
+
this.config?.onExit?.();
|
|
3098
|
+
}
|
|
3099
|
+
} else if (key.name === "escape" || key.name === "p") {
|
|
3100
|
+
this.isPaused = false;
|
|
3101
|
+
this.scheduleNextTick();
|
|
3102
|
+
this.render();
|
|
3103
|
+
} else if (key.name === "q") {
|
|
3104
|
+
this.destroy();
|
|
3105
|
+
this.config?.onExit?.();
|
|
3106
|
+
}
|
|
3107
|
+
return;
|
|
3108
|
+
}
|
|
3109
|
+
if (key.name === "escape" || key.name === "p") {
|
|
3110
|
+
this.isPaused = true;
|
|
3111
|
+
this.pauseMenuIndex = 0;
|
|
3112
|
+
if (this.gameLoopTimer) {
|
|
3113
|
+
clearTimeout(this.gameLoopTimer);
|
|
3114
|
+
this.gameLoopTimer = null;
|
|
3115
|
+
}
|
|
3116
|
+
this.render();
|
|
3117
|
+
return;
|
|
3118
|
+
}
|
|
3119
|
+
if (key.name === "q") {
|
|
3120
|
+
this.destroy();
|
|
3121
|
+
this.config?.onExit?.();
|
|
3122
|
+
return;
|
|
3123
|
+
}
|
|
3124
|
+
if (this.state.isGameOver) {
|
|
3125
|
+
if (key.name === "r") {
|
|
3126
|
+
this.restart();
|
|
3127
|
+
} else if (key.name === "escape" || key.name === "q") {
|
|
3128
|
+
this.destroy();
|
|
3129
|
+
this.config?.onExit?.();
|
|
3130
|
+
}
|
|
3131
|
+
return;
|
|
3132
|
+
}
|
|
3133
|
+
if (key.name === "up" || key.name === "w") {
|
|
3134
|
+
if (this.state.dy !== 1) {
|
|
3135
|
+
this.state.desiredDx = 0;
|
|
3136
|
+
this.state.desiredDy = -1;
|
|
3137
|
+
}
|
|
3138
|
+
} else if (key.name === "down" || key.name === "s") {
|
|
3139
|
+
if (this.state.dy !== -1) {
|
|
3140
|
+
this.state.desiredDx = 0;
|
|
3141
|
+
this.state.desiredDy = 1;
|
|
3142
|
+
}
|
|
3143
|
+
} else if (key.name === "left" || key.name === "a") {
|
|
3144
|
+
if (this.state.dx !== 1) {
|
|
3145
|
+
this.state.desiredDx = -1;
|
|
3146
|
+
this.state.desiredDy = 0;
|
|
3147
|
+
}
|
|
3148
|
+
} else if (key.name === "right" || key.name === "d") {
|
|
3149
|
+
if (this.state.dx !== -1) {
|
|
3150
|
+
this.state.desiredDx = 1;
|
|
3151
|
+
this.state.desiredDy = 0;
|
|
3152
|
+
}
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
render() {
|
|
3156
|
+
const t = this.renderer.getTheme();
|
|
3157
|
+
if (this.showTutorial) {
|
|
3158
|
+
const lines = [
|
|
3159
|
+
"",
|
|
3160
|
+
t.highlight("OBJECTIVE: FEAST AND GROW THE CYBER VIPER"),
|
|
3161
|
+
"",
|
|
3162
|
+
"\u2022 Use Arrow Keys or WASD to steer the viper.",
|
|
3163
|
+
"\u2022 Eat glowing Energy Apples [ \u25C6 ] to grow longer and gain +100 score.",
|
|
3164
|
+
"\u2022 Snag rare Golden Orbs [ \u2605 ] before they vanish for +500 points!",
|
|
3165
|
+
"\u2022 Do NOT crash into the grid borders or your own tail.",
|
|
3166
|
+
"",
|
|
3167
|
+
t.border("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),
|
|
3168
|
+
t.primary("Press Space or Enter to launch \u2502 Esc / Q to Exit")
|
|
3169
|
+
];
|
|
3170
|
+
const box = this.renderer.createBox(lines, 64, "CYBER VIPER MANUAL");
|
|
3171
|
+
this.renderer.clear();
|
|
3172
|
+
this.renderer.draw(`
|
|
3173
|
+
|
|
3174
|
+
${box}
|
|
3175
|
+
`);
|
|
3176
|
+
return;
|
|
3177
|
+
}
|
|
3178
|
+
if (this.isPaused) {
|
|
3179
|
+
const pauseItems = ["Resume Viper (Esc / Enter)", "Restart Round (R)", "Quit to Arcade / Terminal (Q)"];
|
|
3180
|
+
const pauseLines = [
|
|
3181
|
+
"",
|
|
3182
|
+
t.highlight("\u2550\u2550\u2550 VIPER RUN PAUSED \u2550\u2550\u2550"),
|
|
3183
|
+
"",
|
|
3184
|
+
...pauseItems.map((item, idx) => {
|
|
3185
|
+
if (idx === this.pauseMenuIndex) {
|
|
3186
|
+
return t.primary(` \u25B6 ${t.highlight(item)}`);
|
|
3187
|
+
}
|
|
3188
|
+
return t.muted(` ${item}`);
|
|
3189
|
+
}),
|
|
3190
|
+
"",
|
|
3191
|
+
t.border("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),
|
|
3192
|
+
t.muted("Use Up/Down to navigate \u2502 Enter: Select \u2502 Esc: Resume \u2502 Q: Quit")
|
|
3193
|
+
];
|
|
3194
|
+
const pauseBox = this.renderer.createBox(pauseLines, 64, "SYSTEM PAUSE");
|
|
3195
|
+
this.renderer.clear();
|
|
3196
|
+
this.renderer.draw(`
|
|
3197
|
+
|
|
3198
|
+
${pauseBox}
|
|
3199
|
+
`);
|
|
3200
|
+
return;
|
|
3201
|
+
}
|
|
3202
|
+
const header = this.renderer.renderHeader({
|
|
3203
|
+
title: "CYBER VIPER",
|
|
3204
|
+
category: "ARCADE",
|
|
3205
|
+
difficulty: this.config?.difficulty,
|
|
3206
|
+
score: this.state.score
|
|
3207
|
+
});
|
|
3208
|
+
const hudLines = [];
|
|
3209
|
+
const lenStr = `${t.muted("Length:")} ${t.primary(this.state.snake.length.toString())}`;
|
|
3210
|
+
const applesStr = `${t.muted("Apples:")} ${t.accent(this.state.applesEaten.toString())}`;
|
|
3211
|
+
const goldStr = this.state.goldenFoodTicks > 0 ? t.warning(`\u2605 GOLDEN ORB ACTIVE [${Math.ceil(this.state.goldenFoodTicks / 10)}s]`) : "";
|
|
3212
|
+
hudLines.push(` ${lenStr} ${applesStr} ${goldStr}`);
|
|
3213
|
+
const boardLines = [];
|
|
3214
|
+
boardLines.push(` ${t.border("\u2554" + "\u2550\u2550".repeat(GRID_WIDTH) + "\u2557")}`);
|
|
3215
|
+
for (let y = 0; y < GRID_HEIGHT; y++) {
|
|
3216
|
+
let row = ` ${t.border("\u2551")}`;
|
|
3217
|
+
for (let x = 0; x < GRID_WIDTH; x++) {
|
|
3218
|
+
if (x === this.state.snake[0].x && y === this.state.snake[0].y) {
|
|
3219
|
+
row += t.highlight("\u25C6 ");
|
|
3220
|
+
continue;
|
|
3221
|
+
}
|
|
3222
|
+
const isBody = this.state.snake.some((s, idx) => idx > 0 && s.x === x && s.y === y);
|
|
3223
|
+
if (isBody) {
|
|
3224
|
+
row += t.success("\u25A0 ");
|
|
3225
|
+
continue;
|
|
3226
|
+
}
|
|
3227
|
+
if (x === this.state.food.x && y === this.state.food.y) {
|
|
3228
|
+
row += t.error("\u25C6 ");
|
|
3229
|
+
continue;
|
|
3230
|
+
}
|
|
3231
|
+
if (this.state.goldenFood && x === this.state.goldenFood.x && y === this.state.goldenFood.y) {
|
|
3232
|
+
row += t.accent("\u2605 ");
|
|
3233
|
+
continue;
|
|
3234
|
+
}
|
|
3235
|
+
row += " ";
|
|
3236
|
+
}
|
|
3237
|
+
row += t.border("\u2551");
|
|
3238
|
+
boardLines.push(row);
|
|
3239
|
+
}
|
|
3240
|
+
boardLines.push(` ${t.border("\u255A" + "\u2550\u2550".repeat(GRID_WIDTH) + "\u255D")}`);
|
|
3241
|
+
if (this.state.isGameOver) {
|
|
3242
|
+
boardLines.push(`
|
|
3243
|
+
${t.error("\u{1F4A5} COLLISION! VIPER TERMINATED.")}`);
|
|
3244
|
+
boardLines.push(` ${t.accent(`Final Length: ${this.state.snake.length} segments \u2502 Final Score: ${this.state.score}`)}`);
|
|
3245
|
+
boardLines.push(` ${t.muted("Press R to Re-engage, or Esc / Q to Exit.")}`);
|
|
3246
|
+
} else {
|
|
3247
|
+
boardLines.push(`
|
|
3248
|
+
${t.muted("Controls: Arrows/WASD: Steer \u2502 Esc/P: Pause \u2502 Q: Quit")}`);
|
|
3249
|
+
}
|
|
3250
|
+
this.renderer.clear();
|
|
3251
|
+
this.renderer.draw(`
|
|
3252
|
+
${header}
|
|
3253
|
+
${hudLines.join("\n")}
|
|
3254
|
+
${boardLines.join("\n")}
|
|
3255
|
+
`);
|
|
3256
|
+
}
|
|
3257
|
+
getState() {
|
|
3258
|
+
return this.state;
|
|
3259
|
+
}
|
|
3260
|
+
};
|
|
3261
|
+
|
|
2825
3262
|
export {
|
|
2826
3263
|
APP_NAME,
|
|
2827
3264
|
APP_TAGLINE,
|
|
@@ -2851,6 +3288,7 @@ export {
|
|
|
2851
3288
|
DeterministicRNG,
|
|
2852
3289
|
NeonCircuitGame,
|
|
2853
3290
|
ByteRunnerGame,
|
|
2854
|
-
PacketManGame
|
|
3291
|
+
PacketManGame,
|
|
3292
|
+
CyberViperGame
|
|
2855
3293
|
};
|
|
2856
|
-
//# sourceMappingURL=chunk-
|
|
3294
|
+
//# sourceMappingURL=chunk-WCZVPTEK.js.map
|