terminull-arcade 0.0.0-stage → 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/LICENSE +9 -0
- package/README.md +100 -2
- package/dist/chunk-WCZVPTEK.js +3294 -0
- package/dist/chunk-WCZVPTEK.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +154 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +535 -0
- package/dist/index.js +66 -0
- package/dist/index.js.map +1 -0
- package/package.json +68 -4
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,535 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
type GameId = 'packet-man' | 'cyber-viper' | 'neon-circuit' | 'byte-runner' | 'void-invaders' | 'bit-breaker' | 'stack-tower' | 'data-hopper' | 'flappy-byte' | 'cyber-pong' | 'meteor-drift' | 'core-defuser';
|
|
4
|
+
type DifficultyLevel = 'easy' | 'normal' | 'hard' | 'insane';
|
|
5
|
+
type GameCategory = 'puzzle' | 'arcade' | 'strategy' | 'action' | 'educational';
|
|
6
|
+
type ThemeName = 'default' | 'retro-green' | 'neon' | 'minimal' | 'high-contrast';
|
|
7
|
+
interface KeyBinding {
|
|
8
|
+
key: string;
|
|
9
|
+
action: string;
|
|
10
|
+
description: string;
|
|
11
|
+
}
|
|
12
|
+
interface Achievement {
|
|
13
|
+
id: string;
|
|
14
|
+
title: string;
|
|
15
|
+
description: string;
|
|
16
|
+
unlockedAt?: string;
|
|
17
|
+
}
|
|
18
|
+
interface GameMetadata {
|
|
19
|
+
id: GameId;
|
|
20
|
+
name: string;
|
|
21
|
+
tagline: string;
|
|
22
|
+
description: string;
|
|
23
|
+
category: GameCategory;
|
|
24
|
+
difficultyLevels: DifficultyLevel[];
|
|
25
|
+
controls: KeyBinding[];
|
|
26
|
+
achievements: Achievement[];
|
|
27
|
+
author?: string;
|
|
28
|
+
}
|
|
29
|
+
interface GameInitConfig {
|
|
30
|
+
difficulty: DifficultyLevel;
|
|
31
|
+
theme: ThemeName;
|
|
32
|
+
soundEnabled: boolean;
|
|
33
|
+
reducedMotion: boolean;
|
|
34
|
+
seed?: number;
|
|
35
|
+
skipTutorial?: boolean;
|
|
36
|
+
onExit?: () => void;
|
|
37
|
+
onScoreUpdate?: (score: number) => void;
|
|
38
|
+
onGameOver?: (finalScore: number, stats?: Record<string, unknown>) => void;
|
|
39
|
+
onAchievementUnlock?: (achievementId: string) => void;
|
|
40
|
+
}
|
|
41
|
+
interface GameModule {
|
|
42
|
+
readonly id: GameId;
|
|
43
|
+
readonly metadata: GameMetadata;
|
|
44
|
+
init(config: GameInitConfig): Promise<void> | void;
|
|
45
|
+
start(): void;
|
|
46
|
+
pause(): void;
|
|
47
|
+
resume(): void;
|
|
48
|
+
restart(): void;
|
|
49
|
+
saveState(): Record<string, unknown>;
|
|
50
|
+
loadState(state: Record<string, unknown>): void;
|
|
51
|
+
destroy(): void;
|
|
52
|
+
}
|
|
53
|
+
declare const UserSettingsSchema: z.ZodObject<{
|
|
54
|
+
theme: z.ZodDefault<z.ZodEnum<{
|
|
55
|
+
default: "default";
|
|
56
|
+
"retro-green": "retro-green";
|
|
57
|
+
neon: "neon";
|
|
58
|
+
minimal: "minimal";
|
|
59
|
+
"high-contrast": "high-contrast";
|
|
60
|
+
}>>;
|
|
61
|
+
soundEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
62
|
+
reducedMotion: z.ZodDefault<z.ZodBoolean>;
|
|
63
|
+
colorblindMode: z.ZodDefault<z.ZodBoolean>;
|
|
64
|
+
}, z.core.$strip>;
|
|
65
|
+
declare const UserProfileSchema: z.ZodObject<{
|
|
66
|
+
version: z.ZodDefault<z.ZodNumber>;
|
|
67
|
+
createdAt: z.ZodString;
|
|
68
|
+
lastPlayedAt: z.ZodString;
|
|
69
|
+
settings: z.ZodObject<{
|
|
70
|
+
theme: z.ZodDefault<z.ZodEnum<{
|
|
71
|
+
default: "default";
|
|
72
|
+
"retro-green": "retro-green";
|
|
73
|
+
neon: "neon";
|
|
74
|
+
minimal: "minimal";
|
|
75
|
+
"high-contrast": "high-contrast";
|
|
76
|
+
}>>;
|
|
77
|
+
soundEnabled: z.ZodDefault<z.ZodBoolean>;
|
|
78
|
+
reducedMotion: z.ZodDefault<z.ZodBoolean>;
|
|
79
|
+
colorblindMode: z.ZodDefault<z.ZodBoolean>;
|
|
80
|
+
}, z.core.$strip>;
|
|
81
|
+
highScores: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
82
|
+
playCounts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
83
|
+
totalTimePlayedSec: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
84
|
+
unlockedAchievements: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
85
|
+
savedStates: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
type UserSettings = z.infer<typeof UserSettingsSchema>;
|
|
88
|
+
type UserProfile = z.infer<typeof UserProfileSchema>;
|
|
89
|
+
|
|
90
|
+
declare const APP_NAME = "TERMINULL";
|
|
91
|
+
declare const APP_TAGLINE = "Enter the Terminull. Play beyond the prompt.";
|
|
92
|
+
declare const APP_VERSION = "1.0.0";
|
|
93
|
+
declare const MIN_TERMINAL_COLUMNS = 80;
|
|
94
|
+
declare const MIN_TERMINAL_ROWS = 24;
|
|
95
|
+
declare const ALL_GAMES_METADATA: Record<string, GameMetadata>;
|
|
96
|
+
|
|
97
|
+
declare function checkTerminalDimensions(): {
|
|
98
|
+
adequate: boolean;
|
|
99
|
+
cols: number;
|
|
100
|
+
rows: number;
|
|
101
|
+
minCols: number;
|
|
102
|
+
minRows: number;
|
|
103
|
+
};
|
|
104
|
+
declare function playTerminalBell(enabled?: boolean): void;
|
|
105
|
+
declare function formatTime(seconds: number): string;
|
|
106
|
+
declare function clamp(val: number, min: number, max: number): number;
|
|
107
|
+
declare function padCenter(str: string, width: number): string;
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Deterministic Pseudo-Random Number Generator using Mulberry32.
|
|
111
|
+
* Supports seeding for reproducible test scenarios and daily challenge modes.
|
|
112
|
+
*/
|
|
113
|
+
declare class DeterministicRNG {
|
|
114
|
+
private state;
|
|
115
|
+
private readonly initialSeed;
|
|
116
|
+
constructor(seed?: number);
|
|
117
|
+
getSeed(): number;
|
|
118
|
+
reset(): void;
|
|
119
|
+
/**
|
|
120
|
+
* Generates a floating point number in [0, 1).
|
|
121
|
+
*/
|
|
122
|
+
next(): number;
|
|
123
|
+
/**
|
|
124
|
+
* Returns an integer within [min, max] inclusive.
|
|
125
|
+
*/
|
|
126
|
+
nextInt(min: number, max: number): number;
|
|
127
|
+
/**
|
|
128
|
+
* Returns a random element from an array.
|
|
129
|
+
*/
|
|
130
|
+
pick<T>(items: readonly T[]): T;
|
|
131
|
+
/**
|
|
132
|
+
* Shuffles an array in place using Fisher-Yates.
|
|
133
|
+
*/
|
|
134
|
+
shuffle<T>(array: T[]): T[];
|
|
135
|
+
/**
|
|
136
|
+
* Generates a deterministic daily seed integer based on YYYY-MM-DD.
|
|
137
|
+
*/
|
|
138
|
+
static getDailySeed(date?: Date): number;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
interface ColorPalette {
|
|
142
|
+
name: ThemeName;
|
|
143
|
+
displayName: string;
|
|
144
|
+
primary: (text: string) => string;
|
|
145
|
+
secondary: (text: string) => string;
|
|
146
|
+
accent: (text: string) => string;
|
|
147
|
+
muted: (text: string) => string;
|
|
148
|
+
success: (text: string) => string;
|
|
149
|
+
warning: (text: string) => string;
|
|
150
|
+
error: (text: string) => string;
|
|
151
|
+
highlight: (text: string) => string;
|
|
152
|
+
border: (text: string) => string;
|
|
153
|
+
}
|
|
154
|
+
declare const THEMES: Record<ThemeName, ColorPalette>;
|
|
155
|
+
declare function getTheme(themeName?: ThemeName): ColorPalette;
|
|
156
|
+
|
|
157
|
+
declare class StorageManager {
|
|
158
|
+
private configDir;
|
|
159
|
+
private filePath;
|
|
160
|
+
private cachedProfile;
|
|
161
|
+
constructor(customDir?: string);
|
|
162
|
+
getProfilePath(): string;
|
|
163
|
+
ensureDirectory(): void;
|
|
164
|
+
getProfile(): UserProfile;
|
|
165
|
+
saveProfile(profile: UserProfile): void;
|
|
166
|
+
recordScore(gameId: string, score: number): boolean;
|
|
167
|
+
getHighScore(gameId: string): number;
|
|
168
|
+
addPlayTime(gameId: string, seconds: number): void;
|
|
169
|
+
unlockAchievement(gameId: string, achievementId: string): boolean;
|
|
170
|
+
updateSettings(partialSettings: Partial<UserSettings>): UserProfile;
|
|
171
|
+
saveGameState(gameId: string, state: Record<string, unknown>): void;
|
|
172
|
+
loadGameState(gameId: string): Record<string, unknown> | null;
|
|
173
|
+
resetProfile(): void;
|
|
174
|
+
}
|
|
175
|
+
declare const defaultStorage: StorageManager;
|
|
176
|
+
|
|
177
|
+
interface UnlockedEvent {
|
|
178
|
+
gameId: GameId;
|
|
179
|
+
achievement: Achievement;
|
|
180
|
+
timestamp: string;
|
|
181
|
+
}
|
|
182
|
+
declare class AchievementManager {
|
|
183
|
+
private storage;
|
|
184
|
+
private pendingNotifications;
|
|
185
|
+
constructor(storage?: StorageManager);
|
|
186
|
+
getAchievementsForGame(gameId: GameId): {
|
|
187
|
+
achievement: Achievement;
|
|
188
|
+
unlocked: boolean;
|
|
189
|
+
}[];
|
|
190
|
+
unlock(gameId: GameId, achievementId: string): boolean;
|
|
191
|
+
popNotifications(): UnlockedEvent[];
|
|
192
|
+
getTotalStats(): {
|
|
193
|
+
unlockedCount: number;
|
|
194
|
+
totalCount: number;
|
|
195
|
+
percentage: number;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
declare const defaultAchievements: AchievementManager;
|
|
199
|
+
|
|
200
|
+
interface RenderHeaderOptions {
|
|
201
|
+
title: string;
|
|
202
|
+
category?: string;
|
|
203
|
+
difficulty?: DifficultyLevel;
|
|
204
|
+
score?: number;
|
|
205
|
+
highScore?: number;
|
|
206
|
+
theme?: ThemeName;
|
|
207
|
+
level?: number | string;
|
|
208
|
+
}
|
|
209
|
+
declare class TerminalRenderer {
|
|
210
|
+
private inAltBuffer;
|
|
211
|
+
private currentTheme;
|
|
212
|
+
setTheme(themeName: ThemeName): void;
|
|
213
|
+
getTheme(): ColorPalette;
|
|
214
|
+
private previousLineCount;
|
|
215
|
+
enterScreen(): void;
|
|
216
|
+
exitScreen(): void;
|
|
217
|
+
/**
|
|
218
|
+
* Safe frame render with zero flickering.
|
|
219
|
+
* Repaints lines in place with cursor hidden and atomic buffer write,
|
|
220
|
+
* avoiding full-screen blanking clears.
|
|
221
|
+
*/
|
|
222
|
+
renderFrame(content: string): void;
|
|
223
|
+
/**
|
|
224
|
+
* Retained for compatibility. Forwards to flicker-free renderFrame.
|
|
225
|
+
*/
|
|
226
|
+
draw(content: string): void;
|
|
227
|
+
/**
|
|
228
|
+
* Intentionally no-op during active game loop to prevent blank-frame visual strobing.
|
|
229
|
+
*/
|
|
230
|
+
clear(): void;
|
|
231
|
+
/**
|
|
232
|
+
* Explicit full screen wipe when transitioning between major modes.
|
|
233
|
+
*/
|
|
234
|
+
forceClear(): void;
|
|
235
|
+
isWindowAdequate(): {
|
|
236
|
+
adequate: boolean;
|
|
237
|
+
width: number;
|
|
238
|
+
height: number;
|
|
239
|
+
};
|
|
240
|
+
renderSizeWarning(): string;
|
|
241
|
+
createBox(lines: string[], width?: number, title?: string): string;
|
|
242
|
+
renderHeader(options: RenderHeaderOptions): string;
|
|
243
|
+
renderFooter(instructions: string): string;
|
|
244
|
+
}
|
|
245
|
+
declare const defaultRenderer: TerminalRenderer;
|
|
246
|
+
|
|
247
|
+
type KeyPressHandler = (key: {
|
|
248
|
+
name: string;
|
|
249
|
+
ctrl: boolean;
|
|
250
|
+
shift: boolean;
|
|
251
|
+
meta: boolean;
|
|
252
|
+
sequence: string;
|
|
253
|
+
}) => void;
|
|
254
|
+
declare class TerminalInputHandler {
|
|
255
|
+
private isListening;
|
|
256
|
+
private keyPressCallback;
|
|
257
|
+
private onExitCallback;
|
|
258
|
+
constructor();
|
|
259
|
+
start(onKey: KeyPressHandler, onExit?: () => void): void;
|
|
260
|
+
stop(): void;
|
|
261
|
+
private handleKeypress;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
interface EngineEvents {
|
|
265
|
+
onQuitToMenu?: () => void;
|
|
266
|
+
}
|
|
267
|
+
declare class TerminullEngine {
|
|
268
|
+
private gamesRegistry;
|
|
269
|
+
private activeGame;
|
|
270
|
+
private storage;
|
|
271
|
+
private achievements;
|
|
272
|
+
private renderer;
|
|
273
|
+
private input;
|
|
274
|
+
private isPaused;
|
|
275
|
+
private pauseMenuIndex;
|
|
276
|
+
private currentDifficulty;
|
|
277
|
+
private sessionStartTime;
|
|
278
|
+
private onQuitToMenuCallback?;
|
|
279
|
+
constructor(storage?: StorageManager, achievements?: AchievementManager, renderer?: TerminalRenderer);
|
|
280
|
+
registerGame(id: GameId, factory: () => GameModule): void;
|
|
281
|
+
getRegisteredGames(): GameId[];
|
|
282
|
+
launchGame(id: GameId, difficulty?: DifficultyLevel, events?: EngineEvents): void;
|
|
283
|
+
togglePause(): void;
|
|
284
|
+
renderPauseMenu(): void;
|
|
285
|
+
handlePauseInput(keyName: string): void;
|
|
286
|
+
quitGame(): void;
|
|
287
|
+
getActiveGame(): GameModule | null;
|
|
288
|
+
isGamePaused(): boolean;
|
|
289
|
+
}
|
|
290
|
+
declare const defaultEngine: TerminullEngine;
|
|
291
|
+
|
|
292
|
+
interface MenuSelection {
|
|
293
|
+
action: 'play' | 'quit';
|
|
294
|
+
gameId?: GameId;
|
|
295
|
+
difficulty?: DifficultyLevel;
|
|
296
|
+
}
|
|
297
|
+
declare class ArcadeMenu {
|
|
298
|
+
private storage;
|
|
299
|
+
private achievements;
|
|
300
|
+
private renderer;
|
|
301
|
+
private input;
|
|
302
|
+
private selectedIndex;
|
|
303
|
+
private searchQuery;
|
|
304
|
+
private isSearching;
|
|
305
|
+
private currentTab;
|
|
306
|
+
private selectedDifficulty;
|
|
307
|
+
private onSelectCallback;
|
|
308
|
+
constructor(storage?: StorageManager, achievements?: AchievementManager, renderer?: TerminalRenderer);
|
|
309
|
+
open(onSelect: (selection: MenuSelection) => void): void;
|
|
310
|
+
close(): void;
|
|
311
|
+
private getFilteredGames;
|
|
312
|
+
private handleInput;
|
|
313
|
+
render(): void;
|
|
314
|
+
private renderArcadeTab;
|
|
315
|
+
private renderStatsTab;
|
|
316
|
+
private renderSettingsTab;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
type TileType = 'source' | 'target' | 'straight' | 'corner' | 't-shape' | 'cross' | 'blocked';
|
|
320
|
+
type DirectionMask = [boolean, boolean, boolean, boolean];
|
|
321
|
+
interface CircuitTile {
|
|
322
|
+
type: TileType;
|
|
323
|
+
rotation: number;
|
|
324
|
+
baseConnections: DirectionMask;
|
|
325
|
+
currentConnections: DirectionMask;
|
|
326
|
+
isPowered: boolean;
|
|
327
|
+
isFixed: boolean;
|
|
328
|
+
}
|
|
329
|
+
interface NeonCircuitState {
|
|
330
|
+
grid: CircuitTile[][];
|
|
331
|
+
width: number;
|
|
332
|
+
height: number;
|
|
333
|
+
cursorX: number;
|
|
334
|
+
cursorY: number;
|
|
335
|
+
movesRemaining: number;
|
|
336
|
+
maxMoves: number;
|
|
337
|
+
score: number;
|
|
338
|
+
level: number;
|
|
339
|
+
targetsRemaining: number;
|
|
340
|
+
totalTargets: number;
|
|
341
|
+
isWon: boolean;
|
|
342
|
+
isGameOver: boolean;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
declare class NeonCircuitGame implements GameModule {
|
|
346
|
+
readonly id = "neon-circuit";
|
|
347
|
+
readonly metadata: GameMetadata;
|
|
348
|
+
private config;
|
|
349
|
+
private renderer;
|
|
350
|
+
private input;
|
|
351
|
+
private rng;
|
|
352
|
+
private state;
|
|
353
|
+
private isPaused;
|
|
354
|
+
private pauseMenuIndex;
|
|
355
|
+
private showTutorial;
|
|
356
|
+
init(config: GameInitConfig): void;
|
|
357
|
+
start(): void;
|
|
358
|
+
pause(): void;
|
|
359
|
+
resume(): void;
|
|
360
|
+
restart(): void;
|
|
361
|
+
saveState(): Record<string, unknown>;
|
|
362
|
+
loadState(saved: Record<string, unknown>): void;
|
|
363
|
+
destroy(): void;
|
|
364
|
+
private setupLevel;
|
|
365
|
+
private createRandomTile;
|
|
366
|
+
private rotateMask;
|
|
367
|
+
rotateTileAt(x: number, y: number): boolean;
|
|
368
|
+
updatePowerFlow(): void;
|
|
369
|
+
private handleInput;
|
|
370
|
+
render(): void;
|
|
371
|
+
private getTileGlyph;
|
|
372
|
+
getState(): NeonCircuitState;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
interface ByteRunnerState {
|
|
376
|
+
playerLane: number;
|
|
377
|
+
isJumping: boolean;
|
|
378
|
+
jumpTicksRemaining: number;
|
|
379
|
+
score: number;
|
|
380
|
+
distance: number;
|
|
381
|
+
cleanBytesCollected: number;
|
|
382
|
+
activeShield: boolean;
|
|
383
|
+
slowMotionTicks: number;
|
|
384
|
+
magnetTicks: number;
|
|
385
|
+
doubleScoreTicks: number;
|
|
386
|
+
speedMs: number;
|
|
387
|
+
isGameOver: boolean;
|
|
388
|
+
multiplier: number;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
declare class ByteRunnerGame implements GameModule {
|
|
392
|
+
readonly id = "byte-runner";
|
|
393
|
+
readonly metadata: GameMetadata;
|
|
394
|
+
private config;
|
|
395
|
+
private renderer;
|
|
396
|
+
private input;
|
|
397
|
+
private rng;
|
|
398
|
+
private gameLoopTimer;
|
|
399
|
+
private entityIdCounter;
|
|
400
|
+
private entities;
|
|
401
|
+
private state;
|
|
402
|
+
private isPaused;
|
|
403
|
+
private pauseMenuIndex;
|
|
404
|
+
private showTutorial;
|
|
405
|
+
init(config: GameInitConfig): void;
|
|
406
|
+
start(): void;
|
|
407
|
+
pause(): void;
|
|
408
|
+
resume(): void;
|
|
409
|
+
restart(): void;
|
|
410
|
+
saveState(): Record<string, unknown>;
|
|
411
|
+
loadState(saved: Record<string, unknown>): void;
|
|
412
|
+
destroy(): void;
|
|
413
|
+
private resetState;
|
|
414
|
+
private scheduleNextTick;
|
|
415
|
+
tick(): void;
|
|
416
|
+
private activatePowerUp;
|
|
417
|
+
private spawnHighwayWave;
|
|
418
|
+
private handleInput;
|
|
419
|
+
render(): void;
|
|
420
|
+
getState(): ByteRunnerState;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
interface PacketManState {
|
|
424
|
+
playerX: number;
|
|
425
|
+
playerY: number;
|
|
426
|
+
playerDx: number;
|
|
427
|
+
playerDy: number;
|
|
428
|
+
desiredDx: number;
|
|
429
|
+
desiredDy: number;
|
|
430
|
+
mouthOpen: boolean;
|
|
431
|
+
lives: number;
|
|
432
|
+
score: number;
|
|
433
|
+
level: number;
|
|
434
|
+
pelletsRemaining: number;
|
|
435
|
+
totalPellets: number;
|
|
436
|
+
frightenedTicksRemaining: number;
|
|
437
|
+
frightenedCombo: number;
|
|
438
|
+
isWon: boolean;
|
|
439
|
+
isGameOver: boolean;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
declare class PacketManGame implements GameModule {
|
|
443
|
+
readonly id = "packet-man";
|
|
444
|
+
readonly metadata: GameMetadata;
|
|
445
|
+
private config;
|
|
446
|
+
private renderer;
|
|
447
|
+
private input;
|
|
448
|
+
private rng;
|
|
449
|
+
private gameLoopTimer;
|
|
450
|
+
private grid;
|
|
451
|
+
private daemons;
|
|
452
|
+
private daemonsChompedInSurge;
|
|
453
|
+
private pelletsEatenCount;
|
|
454
|
+
private state;
|
|
455
|
+
private isPaused;
|
|
456
|
+
private pauseMenuIndex;
|
|
457
|
+
private showTutorial;
|
|
458
|
+
private tickIntervalMs;
|
|
459
|
+
init(config: GameInitConfig): void;
|
|
460
|
+
start(): void;
|
|
461
|
+
pause(): void;
|
|
462
|
+
resume(): void;
|
|
463
|
+
restart(): void;
|
|
464
|
+
saveState(): Record<string, unknown>;
|
|
465
|
+
loadState(saved: Record<string, unknown>): void;
|
|
466
|
+
destroy(): void;
|
|
467
|
+
private resetGame;
|
|
468
|
+
private loadMaze;
|
|
469
|
+
private resetDaemons;
|
|
470
|
+
private scheduleNextTick;
|
|
471
|
+
tick(): void;
|
|
472
|
+
private canMove;
|
|
473
|
+
private chompCurrentTile;
|
|
474
|
+
private moveDaemons;
|
|
475
|
+
private checkCollisions;
|
|
476
|
+
private handleInput;
|
|
477
|
+
render(): void;
|
|
478
|
+
private getPlayerGlyph;
|
|
479
|
+
private getDaemonGlyph;
|
|
480
|
+
getState(): PacketManState;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
interface Point {
|
|
484
|
+
x: number;
|
|
485
|
+
y: number;
|
|
486
|
+
}
|
|
487
|
+
interface CyberViperState {
|
|
488
|
+
snake: Point[];
|
|
489
|
+
dx: number;
|
|
490
|
+
dy: number;
|
|
491
|
+
desiredDx: number;
|
|
492
|
+
desiredDy: number;
|
|
493
|
+
food: Point;
|
|
494
|
+
goldenFood: Point | null;
|
|
495
|
+
goldenFoodTicks: number;
|
|
496
|
+
score: number;
|
|
497
|
+
highScore: number;
|
|
498
|
+
applesEaten: number;
|
|
499
|
+
isGameOver: boolean;
|
|
500
|
+
isWon: boolean;
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
declare class CyberViperGame implements GameModule {
|
|
504
|
+
readonly id = "cyber-viper";
|
|
505
|
+
readonly metadata: GameMetadata;
|
|
506
|
+
private config;
|
|
507
|
+
private renderer;
|
|
508
|
+
private input;
|
|
509
|
+
private rng;
|
|
510
|
+
private gameLoopTimer;
|
|
511
|
+
private state;
|
|
512
|
+
private isPaused;
|
|
513
|
+
private pauseMenuIndex;
|
|
514
|
+
private showTutorial;
|
|
515
|
+
private tickIntervalMs;
|
|
516
|
+
init(config: GameInitConfig): void;
|
|
517
|
+
start(): void;
|
|
518
|
+
pause(): void;
|
|
519
|
+
resume(): void;
|
|
520
|
+
restart(): void;
|
|
521
|
+
saveState(): Record<string, unknown>;
|
|
522
|
+
loadState(saved: Record<string, unknown>): void;
|
|
523
|
+
destroy(): void;
|
|
524
|
+
private resetState;
|
|
525
|
+
private scheduleNextTick;
|
|
526
|
+
tick(): void;
|
|
527
|
+
private spawnFood;
|
|
528
|
+
private spawnGoldenFood;
|
|
529
|
+
private handleInput;
|
|
530
|
+
render(): void;
|
|
531
|
+
getState(): CyberViperState;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
export { ALL_GAMES_METADATA, APP_NAME, APP_TAGLINE, APP_VERSION, AchievementManager, ArcadeMenu, ByteRunnerGame, CyberViperGame, DeterministicRNG, MIN_TERMINAL_COLUMNS, MIN_TERMINAL_ROWS, NeonCircuitGame, PacketManGame, StorageManager, THEMES, TerminalInputHandler, TerminalRenderer, TerminullEngine, UserProfileSchema, UserSettingsSchema, checkTerminalDimensions, clamp, defaultAchievements, defaultEngine, defaultRenderer, defaultStorage, formatTime, getTheme, padCenter, playTerminalBell };
|
|
535
|
+
export type { Achievement, ColorPalette, DifficultyLevel, EngineEvents, GameCategory, GameId, GameInitConfig, GameMetadata, GameModule, KeyBinding, KeyPressHandler, MenuSelection, RenderHeaderOptions, ThemeName, UnlockedEvent, UserProfile, UserSettings };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ALL_GAMES_METADATA,
|
|
4
|
+
APP_NAME,
|
|
5
|
+
APP_TAGLINE,
|
|
6
|
+
APP_VERSION,
|
|
7
|
+
AchievementManager,
|
|
8
|
+
ArcadeMenu,
|
|
9
|
+
ByteRunnerGame,
|
|
10
|
+
CyberViperGame,
|
|
11
|
+
DeterministicRNG,
|
|
12
|
+
MIN_TERMINAL_COLUMNS,
|
|
13
|
+
MIN_TERMINAL_ROWS,
|
|
14
|
+
NeonCircuitGame,
|
|
15
|
+
PacketManGame,
|
|
16
|
+
StorageManager,
|
|
17
|
+
THEMES,
|
|
18
|
+
TerminalInputHandler,
|
|
19
|
+
TerminalRenderer,
|
|
20
|
+
TerminullEngine,
|
|
21
|
+
UserProfileSchema,
|
|
22
|
+
UserSettingsSchema,
|
|
23
|
+
checkTerminalDimensions,
|
|
24
|
+
clamp,
|
|
25
|
+
defaultAchievements,
|
|
26
|
+
defaultEngine,
|
|
27
|
+
defaultRenderer,
|
|
28
|
+
defaultStorage,
|
|
29
|
+
formatTime,
|
|
30
|
+
getTheme,
|
|
31
|
+
padCenter,
|
|
32
|
+
playTerminalBell
|
|
33
|
+
} from "./chunk-WCZVPTEK.js";
|
|
34
|
+
export {
|
|
35
|
+
ALL_GAMES_METADATA,
|
|
36
|
+
APP_NAME,
|
|
37
|
+
APP_TAGLINE,
|
|
38
|
+
APP_VERSION,
|
|
39
|
+
AchievementManager,
|
|
40
|
+
ArcadeMenu,
|
|
41
|
+
ByteRunnerGame,
|
|
42
|
+
CyberViperGame,
|
|
43
|
+
DeterministicRNG,
|
|
44
|
+
MIN_TERMINAL_COLUMNS,
|
|
45
|
+
MIN_TERMINAL_ROWS,
|
|
46
|
+
NeonCircuitGame,
|
|
47
|
+
PacketManGame,
|
|
48
|
+
StorageManager,
|
|
49
|
+
THEMES,
|
|
50
|
+
TerminalInputHandler,
|
|
51
|
+
TerminalRenderer,
|
|
52
|
+
TerminullEngine,
|
|
53
|
+
UserProfileSchema,
|
|
54
|
+
UserSettingsSchema,
|
|
55
|
+
checkTerminalDimensions,
|
|
56
|
+
clamp,
|
|
57
|
+
defaultAchievements,
|
|
58
|
+
defaultEngine,
|
|
59
|
+
defaultRenderer,
|
|
60
|
+
defaultStorage,
|
|
61
|
+
formatTime,
|
|
62
|
+
getTheme,
|
|
63
|
+
padCenter,
|
|
64
|
+
playTerminalBell
|
|
65
|
+
};
|
|
66
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,70 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "terminull-arcade",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "Enter the Terminull. Play beyond the prompt. A curated arcade of original terminal games.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"terminull-arcade": "./dist/cli.js",
|
|
8
|
+
"terminull": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"publishConfig": {
|
|
13
|
+
"access": "public"
|
|
14
|
+
},
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18.0.0"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"dev": "tsup --watch",
|
|
31
|
+
"build": "tsup",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest",
|
|
34
|
+
"lint": "eslint src/",
|
|
35
|
+
"format": "prettier --check \"src/**/*.{ts,tsx}\"",
|
|
36
|
+
"format:write": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"prepare": "pnpm build"
|
|
39
|
+
},
|
|
40
|
+
"keywords": [
|
|
41
|
+
"terminal",
|
|
42
|
+
"games",
|
|
43
|
+
"arcade",
|
|
44
|
+
"cli",
|
|
45
|
+
"ink",
|
|
46
|
+
"typescript",
|
|
47
|
+
"retro",
|
|
48
|
+
"ascii",
|
|
49
|
+
"puzzle",
|
|
50
|
+
"cyberpunk"
|
|
51
|
+
],
|
|
52
|
+
"author": "Terminull Arcade Systems",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"chalk": "^6.0.1",
|
|
56
|
+
"commander": "^15.1.0",
|
|
57
|
+
"ink": "^5.2.1",
|
|
58
|
+
"react": "^18.3.1",
|
|
59
|
+
"zod": "^4.6.7"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@types/node": "^26.6.10",
|
|
63
|
+
"@types/react": "^18.3.32",
|
|
64
|
+
"eslint": "^10.15.0",
|
|
65
|
+
"prettier": "^3.10.1",
|
|
66
|
+
"tsup": "^9.0.0",
|
|
67
|
+
"typescript": "^5.9.3",
|
|
68
|
+
"vitest": "^5.1.2"
|
|
69
|
+
}
|
|
70
|
+
}
|