terminull-arcade 1.0.3 → 1.0.4
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 +32 -15
- package/dist/{chunk-EQAKR7UF.js → chunk-Z5UIN4FP.js} +1758 -2
- package/dist/chunk-Z5UIN4FP.js.map +1 -0
- package/dist/cli.js +13 -1
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +220 -4
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/launch.ps1 +110 -0
- package/launch.sh +79 -0
- package/package.json +8 -2
- package/terminull +3 -0
- package/terminull.cmd +16 -0
- package/terminull.ps1 +7 -0
- package/dist/chunk-EQAKR7UF.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -5,12 +5,15 @@ import {
|
|
|
5
5
|
APP_TAGLINE,
|
|
6
6
|
APP_VERSION,
|
|
7
7
|
ArcadeMenu,
|
|
8
|
+
ByteHopperGame,
|
|
8
9
|
Cyber2048Game,
|
|
9
10
|
CyberBreakoutGame,
|
|
10
11
|
CyberDinoGame,
|
|
12
|
+
CyberSweeperGame,
|
|
11
13
|
CyberTowerGame,
|
|
12
14
|
CyberViperGame,
|
|
13
15
|
HashMatrixGame,
|
|
16
|
+
NeonFlapGame,
|
|
14
17
|
PacketManGame,
|
|
15
18
|
VoidInvadersGame,
|
|
16
19
|
defaultAchievements,
|
|
@@ -19,7 +22,7 @@ import {
|
|
|
19
22
|
defaultStorage,
|
|
20
23
|
formatTime,
|
|
21
24
|
playArcadeLoadingScreen
|
|
22
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-Z5UIN4FP.js";
|
|
23
26
|
|
|
24
27
|
// src/cli.ts
|
|
25
28
|
import { Command } from "commander";
|
|
@@ -33,6 +36,9 @@ defaultEngine.registerGame("cyber-dino", () => new CyberDinoGame());
|
|
|
33
36
|
defaultEngine.registerGame("cyber-breakout", () => new CyberBreakoutGame());
|
|
34
37
|
defaultEngine.registerGame("cyber-2048", () => new Cyber2048Game());
|
|
35
38
|
defaultEngine.registerGame("cyber-tower", () => new CyberTowerGame());
|
|
39
|
+
defaultEngine.registerGame("byte-hopper", () => new ByteHopperGame());
|
|
40
|
+
defaultEngine.registerGame("cyber-sweeper", () => new CyberSweeperGame());
|
|
41
|
+
defaultEngine.registerGame("neon-flap", () => new NeonFlapGame());
|
|
36
42
|
var program = new Command();
|
|
37
43
|
program.name("terminull-arcade").description(`${chalk.cyanBright.bold(APP_NAME)} - ${APP_TAGLINE}`).version(APP_VERSION);
|
|
38
44
|
program.option("-y, --yes", "Skip entry confirmation prompt").action((options) => {
|
|
@@ -109,6 +115,12 @@ program.command("play <game-id>").description("Launch a game directly by ID").op
|
|
|
109
115
|
targetGameId = "cyber-2048";
|
|
110
116
|
} else if (gameId === "tower" || gameId === "stack" || gameId === "cyber-tower" || gameId === "tower-stacker" || gameId === "tower-builder") {
|
|
111
117
|
targetGameId = "cyber-tower";
|
|
118
|
+
} else if (gameId === "hopper" || gameId === "frogger" || gameId === "byte-hopper" || gameId === "bytehopper") {
|
|
119
|
+
targetGameId = "byte-hopper";
|
|
120
|
+
} else if (gameId === "sweeper" || gameId === "minesweeper" || gameId === "cyber-sweeper" || gameId === "mines") {
|
|
121
|
+
targetGameId = "cyber-sweeper";
|
|
122
|
+
} else if (gameId === "flap" || gameId === "flappy" || gameId === "neon-flap" || gameId === "bit-flap") {
|
|
123
|
+
targetGameId = "neon-flap";
|
|
112
124
|
}
|
|
113
125
|
if (targetGameId === "level-devil") {
|
|
114
126
|
console.log(chalk.yellowBright('\nNotice: "level-devil" is currently disabled from the active CLI roster.\n'));
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { APP_NAME, APP_TAGLINE, APP_VERSION, ALL_GAMES_METADATA } from './shared/constants.js';\nimport { GameId, DifficultyLevel } from './shared/types.js';\nimport { defaultStorage } from './core/storage.js';\nimport { defaultAchievements } from './core/achievements.js';\nimport { defaultEngine } from './core/engine.js';\nimport { ArcadeMenu, playArcadeLoadingScreen } from './core/menu.js';\nimport { defaultRenderer } from './core/renderer.js';\nimport { formatTime } from './shared/utils.js';\nimport { PacketManGame } from './games/packet-man/index.js';\nimport { CyberViperGame } from './games/cyber-viper/index.js';\nimport { VoidInvadersGame } from './games/void-invaders/index.js';\nimport { HashMatrixGame } from './games/hash-matrix/index.js';\nimport { CyberDinoGame } from './games/cyber-dino/index.js';\nimport { LevelDevilGame } from './games/level-devil/index.js';\nimport { CyberBreakoutGame } from './games/cyber-breakout/index.js';\nimport { Cyber2048Game } from './games/cyber-2048/index.js';\nimport { CyberTowerGame } from './games/cyber-tower/index.js';\n\n// Register active games\ndefaultEngine.registerGame('packet-man', () => new PacketManGame());\ndefaultEngine.registerGame('cyber-viper', () => new CyberViperGame());\ndefaultEngine.registerGame('void-invaders', () => new VoidInvadersGame());\ndefaultEngine.registerGame('hash-matrix', () => new HashMatrixGame());\n// defaultEngine.registerGame('level-devil', () => new LevelDevilGame()); // Temporarily disabled\ndefaultEngine.registerGame('cyber-dino', () => new CyberDinoGame());\ndefaultEngine.registerGame('cyber-breakout', () => new CyberBreakoutGame());\ndefaultEngine.registerGame('cyber-2048', () => new Cyber2048Game());\ndefaultEngine.registerGame('cyber-tower', () => new CyberTowerGame());\n\nconst program = new Command();\n\nprogram\n .name('terminull-arcade')\n .description(`${chalk.cyanBright.bold(APP_NAME)} - ${APP_TAGLINE}`)\n .version(APP_VERSION);\n\nimport readline from 'node:readline';\n\n// Default action: prompt to enter arcade with (y) confirmation\nprogram\n .option('-y, --yes', 'Skip entry confirmation prompt')\n .action((options: { yes?: boolean }) => {\n if (options.yes) {\n launchInteractiveMenu();\n return;\n }\n\n promptToEnterArcade();\n });\n\nfunction promptToEnterArcade(): void {\n const nodeVersion = process.version;\n console.log(`\\n${chalk.cyanBright.bold(' ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗██╗ ██╗██╗ ██╗ ')}`);\n console.log(chalk.cyanBright.bold(' ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██║ ██║██║ ██║ '));\n console.log(chalk.magentaBright(' ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║██║ ██║██║ ██║ '));\n console.log(chalk.magentaBright(' ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██║ ██║██║ ██║ '));\n console.log(chalk.gray(' ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║╚██████╔╝███████╗███████╗'));\n console.log(chalk.gray(' ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚══════╝'));\n console.log(`\\n ${chalk.yellowBright(APP_TAGLINE)}`);\n console.log(` ${chalk.greenBright('✓')} Node.js Runtime Verified: ${chalk.whiteBright(nodeVersion)} (Node.js 18+ required)`);\n console.log(` ${chalk.gray('All arcade games run 100% locally with zero external network access.')}\\n`);\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n rl.question(` ${chalk.cyanBright.bold('Enter Terminull Arcade?')} ${chalk.gray('(y/n) [default: y]: ')}`, (answer) => {\n rl.close();\n const trimmed = answer.trim().toLowerCase();\n if (!trimmed || trimmed === 'y' || trimmed === 'yes') {\n launchInteractiveMenu();\n } else {\n console.log(`\\n ${chalk.gray('Arcade launch aborted.')}`);\n console.log(` ${chalk.gray('Whenever you are ready, run:')} ${chalk.cyan('npx terminull-arcade')}\\n`);\n process.exit(0);\n }\n });\n}\n\nprogram\n .command('list')\n .description('List all available games in the Terminull arcade')\n .action(() => {\n const profile = defaultStorage.getProfile();\n console.log(`\\n${chalk.cyanBright.bold('=== TERMINULL ARCADE ROSTER ===')}\\n`);\n console.log(chalk.gray(`ID`.padEnd(18) + `NAME`.padEnd(20) + `CATEGORY`.padEnd(14) + `HIGH SCORE`));\n console.log(chalk.gray('─'.repeat(65)));\n\n const activeGames = Object.values(ALL_GAMES_METADATA).filter((g) => g.id !== 'level-devil');\n for (const game of activeGames) {\n const high = profile.highScores[game.id] || 0;\n console.log(\n chalk.cyan(game.id.padEnd(18)) +\n chalk.whiteBright(game.name.padEnd(20)) +\n chalk.magenta(game.category.padEnd(14)) +\n chalk.yellow(high.toString())\n );\n }\n console.log(`\\n${chalk.gray('Run')} ${chalk.cyan('npx terminull-arcade play <game-id>')} ${chalk.gray('to launch directly.')}\\n`);\n });\n\nprogram\n .command('play <game-id>')\n .description('Launch a game directly by ID')\n .option('-d, --difficulty <level>', 'Difficulty: easy, normal, hard, insane', 'normal')\n .action(async (gameId: string, options: { difficulty: string }) => {\n const validDiff: DifficultyLevel = ['easy', 'normal', 'hard', 'insane'].includes(options.difficulty)\n ? (options.difficulty as DifficultyLevel)\n : 'normal';\n\n let targetGameId = gameId as GameId;\n if (gameId === 'space-invaders') {\n targetGameId = 'void-invaders';\n } else if (gameId === 'matrix' || gameId === 'hacker' || gameId === 'hash') {\n targetGameId = 'hash-matrix';\n } else if (gameId === 'dino' || gameId === 'chrome-dino' || gameId === 'jumping-dino' || gameId === 'trex') {\n targetGameId = 'cyber-dino';\n } else if (gameId === 'devil' || gameId === 'level-devil' || gameId === 'rage') {\n targetGameId = 'level-devil';\n } else if (gameId === 'breakout' || gameId === 'cyber-breakout' || gameId === 'arkanoid' || gameId === 'bricks') {\n targetGameId = 'cyber-breakout';\n } else if (gameId === '2048' || gameId === 'cyber-2048' || gameId === 'matrix-2048' || gameId === 'tile-2048') {\n targetGameId = 'cyber-2048';\n } else if (gameId === 'tower' || gameId === 'stack' || gameId === 'cyber-tower' || gameId === 'tower-stacker' || gameId === 'tower-builder') {\n targetGameId = 'cyber-tower';\n }\n\n if (targetGameId === 'level-devil') {\n console.log(chalk.yellowBright('\\nNotice: \"level-devil\" is currently disabled from the active CLI roster.\\n'));\n process.exit(0);\n }\n\n if (!ALL_GAMES_METADATA[targetGameId]) {\n console.error(chalk.redBright(`\\nError: Unknown game ID \"${gameId}\".`));\n console.log(`Run ${chalk.cyan('npx terminull-arcade list')} to view valid game IDs.\\n`);\n process.exit(1);\n }\n\n if (!defaultEngine.getRegisteredGames().includes(targetGameId)) {\n console.error(chalk.yellowBright(`\\nNotice: \"${gameId}\" implementation is staged in pipeline.`));\n console.log(`Currently playable games: ${chalk.cyan(defaultEngine.getRegisteredGames().join(', '))}\\n`);\n process.exit(0);\n }\n\n const meta = ALL_GAMES_METADATA[targetGameId]!;\n await playArcadeLoadingScreen(meta, defaultRenderer, defaultStorage);\n\n defaultEngine.launchGame(targetGameId, validDiff, {\n onQuitToMenu: () => {\n launchInteractiveMenu();\n },\n });\n });\n\nprogram\n .command('stats')\n .description('Display career statistics and achievements')\n .action(() => {\n const profile = defaultStorage.getProfile();\n const stats = defaultAchievements.getTotalStats();\n\n let totalScore = 0;\n let totalPlays = 0;\n let totalSec = 0;\n\n for (const id of Object.keys(ALL_GAMES_METADATA)) {\n totalScore += profile.highScores[id] || 0;\n totalPlays += profile.playCounts[id] || 0;\n totalSec += profile.totalTimePlayedSec[id] || 0;\n }\n\n console.log(`\\n${chalk.cyanBright.bold('=== TERMINULL PILOT TELEMETRY ===')}\\n`);\n console.log(`${chalk.gray('Cumulative High Score:')} ${chalk.yellowBright(totalScore.toLocaleString())}`);\n console.log(`${chalk.gray('Total Play Sessions:')} ${chalk.cyanBright(totalPlays)}`);\n console.log(`${chalk.gray('Total Time in Engine:')} ${chalk.magentaBright(formatTime(totalSec))}`);\n console.log(`${chalk.gray('Achievements Unlocked:')} ${chalk.greenBright(`${stats.unlockedCount} / ${stats.totalCount} (${stats.percentage}%)`)}`);\n console.log(`${chalk.gray('Current Active Theme:')} ${chalk.whiteBright(profile.settings.theme)}`);\n console.log(`${chalk.gray('Profile Path:')} ${chalk.gray(defaultStorage.getProfilePath())}\\n`);\n });\n\nprogram\n .command('reset')\n .description('Reset local high scores, achievements, and stats')\n .option('-f, --force', 'Force reset without confirmation prompt')\n .action(() => {\n defaultStorage.resetProfile();\n console.log(chalk.greenBright('\\n✓ Terminull local profile, high scores, and achievements have been reset.\\n'));\n });\n\nfunction launchInteractiveMenu(): void {\n const menu = new ArcadeMenu();\n menu.open((selection) => {\n if (selection.action === 'play' && selection.gameId) {\n if (!defaultEngine.getRegisteredGames().includes(selection.gameId)) {\n console.log(chalk.yellowBright(`\\nGame \"${selection.gameId}\" is staged in the pipeline.\\n`));\n process.exit(0);\n }\n defaultEngine.launchGame(selection.gameId, selection.difficulty, {\n onQuitToMenu: () => launchInteractiveMenu(),\n });\n } else {\n process.exit(0);\n }\n });\n}\n\nprogram.parse(process.argv);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,OAAO,WAAW;AAqClB,OAAO,cAAc;AAjBrB,cAAc,aAAa,cAAc,MAAM,IAAI,cAAc,CAAC;AAClE,cAAc,aAAa,eAAe,MAAM,IAAI,eAAe,CAAC;AACpE,cAAc,aAAa,iBAAiB,MAAM,IAAI,iBAAiB,CAAC;AACxE,cAAc,aAAa,eAAe,MAAM,IAAI,eAAe,CAAC;AAEpE,cAAc,aAAa,cAAc,MAAM,IAAI,cAAc,CAAC;AAClE,cAAc,aAAa,kBAAkB,MAAM,IAAI,kBAAkB,CAAC;AAC1E,cAAc,aAAa,cAAc,MAAM,IAAI,cAAc,CAAC;AAClE,cAAc,aAAa,eAAe,MAAM,IAAI,eAAe,CAAC;AAEpE,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,kBAAkB,EACvB,YAAY,GAAG,MAAM,WAAW,KAAK,QAAQ,CAAC,MAAM,WAAW,EAAE,EACjE,QAAQ,WAAW;AAKtB,QACG,OAAO,aAAa,gCAAgC,EACpD,OAAO,CAAC,YAA+B;AACtC,MAAI,QAAQ,KAAK;AACf,0BAAsB;AACtB;AAAA,EACF;AAEA,sBAAoB;AACtB,CAAC;AAEH,SAAS,sBAA4B;AACnC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c,mBAAmB,EAAE,SAAS,UAAU,MAAM,GAAG;AAClE,gBAAQ,IAAI,MAAM,aAAa;AAAA,QAAW,UAAU,MAAM;AAAA,CAAgC,CAAC;AAC3F,gBAAQ,KAAK,CAAC;AAAA,MAChB;AACA,oBAAc,WAAW,UAAU,QAAQ,UAAU,YAAY;AAAA,QAC/D,cAAc,MAAM,sBAAsB;AAAA,MAC5C,CAAC;AAAA,IACH,OAAO;AACL,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACH;AAEA,QAAQ,MAAM,QAAQ,IAAI;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts"],"sourcesContent":["import { Command } from 'commander';\nimport chalk from 'chalk';\nimport { APP_NAME, APP_TAGLINE, APP_VERSION, ALL_GAMES_METADATA } from './shared/constants.js';\nimport { GameId, DifficultyLevel } from './shared/types.js';\nimport { defaultStorage } from './core/storage.js';\nimport { defaultAchievements } from './core/achievements.js';\nimport { defaultEngine } from './core/engine.js';\nimport { ArcadeMenu, playArcadeLoadingScreen } from './core/menu.js';\nimport { defaultRenderer } from './core/renderer.js';\nimport { formatTime } from './shared/utils.js';\nimport { PacketManGame } from './games/packet-man/index.js';\nimport { CyberViperGame } from './games/cyber-viper/index.js';\nimport { VoidInvadersGame } from './games/void-invaders/index.js';\nimport { HashMatrixGame } from './games/hash-matrix/index.js';\nimport { CyberDinoGame } from './games/cyber-dino/index.js';\nimport { LevelDevilGame } from './games/level-devil/index.js';\nimport { CyberBreakoutGame } from './games/cyber-breakout/index.js';\nimport { Cyber2048Game } from './games/cyber-2048/index.js';\nimport { CyberTowerGame } from './games/cyber-tower/index.js';\nimport { ByteHopperGame } from './games/byte-hopper/index.js';\nimport { CyberSweeperGame } from './games/cyber-sweeper/index.js';\nimport { NeonFlapGame } from './games/neon-flap/index.js';\n\n// Register active games\ndefaultEngine.registerGame('packet-man', () => new PacketManGame());\ndefaultEngine.registerGame('cyber-viper', () => new CyberViperGame());\ndefaultEngine.registerGame('void-invaders', () => new VoidInvadersGame());\ndefaultEngine.registerGame('hash-matrix', () => new HashMatrixGame());\n// defaultEngine.registerGame('level-devil', () => new LevelDevilGame()); // Temporarily disabled\ndefaultEngine.registerGame('cyber-dino', () => new CyberDinoGame());\ndefaultEngine.registerGame('cyber-breakout', () => new CyberBreakoutGame());\ndefaultEngine.registerGame('cyber-2048', () => new Cyber2048Game());\ndefaultEngine.registerGame('cyber-tower', () => new CyberTowerGame());\ndefaultEngine.registerGame('byte-hopper', () => new ByteHopperGame());\ndefaultEngine.registerGame('cyber-sweeper', () => new CyberSweeperGame());\ndefaultEngine.registerGame('neon-flap', () => new NeonFlapGame());\n\nconst program = new Command();\n\nprogram\n .name('terminull-arcade')\n .description(`${chalk.cyanBright.bold(APP_NAME)} - ${APP_TAGLINE}`)\n .version(APP_VERSION);\n\nimport readline from 'node:readline';\n\n// Default action: prompt to enter arcade with (y) confirmation\nprogram\n .option('-y, --yes', 'Skip entry confirmation prompt')\n .action((options: { yes?: boolean }) => {\n if (options.yes) {\n launchInteractiveMenu();\n return;\n }\n\n promptToEnterArcade();\n });\n\nfunction promptToEnterArcade(): void {\n const nodeVersion = process.version;\n console.log(`\\n${chalk.cyanBright.bold(' ████████╗███████╗██████╗ ███╗ ███╗██╗███╗ ██╗██╗ ██╗██╗ ██╗ ')}`);\n console.log(chalk.cyanBright.bold(' ╚══██╔══╝██╔════╝██╔══██╗████╗ ████║██║████╗ ██║██║ ██║██║ ██║ '));\n console.log(chalk.magentaBright(' ██║ █████╗ ██████╔╝██╔████╔██║██║██╔██╗ ██║██║ ██║██║ ██║ '));\n console.log(chalk.magentaBright(' ██║ ██╔══╝ ██╔══██╗██║╚██╔╝██║██║██║╚██╗██║██║ ██║██║ ██║ '));\n console.log(chalk.gray(' ██║ ███████╗██║ ██║██║ ╚═╝ ██║██║██║ ╚████║╚██████╔╝███████╗███████╗'));\n console.log(chalk.gray(' ╚═╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚══════╝╚══════╝'));\n console.log(`\\n ${chalk.yellowBright(APP_TAGLINE)}`);\n console.log(` ${chalk.greenBright('✓')} Node.js Runtime Verified: ${chalk.whiteBright(nodeVersion)} (Node.js 18+ required)`);\n console.log(` ${chalk.gray('All arcade games run 100% locally with zero external network access.')}\\n`);\n\n const rl = readline.createInterface({\n input: process.stdin,\n output: process.stdout,\n });\n\n rl.question(` ${chalk.cyanBright.bold('Enter Terminull Arcade?')} ${chalk.gray('(y/n) [default: y]: ')}`, (answer) => {\n rl.close();\n const trimmed = answer.trim().toLowerCase();\n if (!trimmed || trimmed === 'y' || trimmed === 'yes') {\n launchInteractiveMenu();\n } else {\n console.log(`\\n ${chalk.gray('Arcade launch aborted.')}`);\n console.log(` ${chalk.gray('Whenever you are ready, run:')} ${chalk.cyan('npx terminull-arcade')}\\n`);\n process.exit(0);\n }\n });\n}\n\nprogram\n .command('list')\n .description('List all available games in the Terminull arcade')\n .action(() => {\n const profile = defaultStorage.getProfile();\n console.log(`\\n${chalk.cyanBright.bold('=== TERMINULL ARCADE ROSTER ===')}\\n`);\n console.log(chalk.gray(`ID`.padEnd(18) + `NAME`.padEnd(20) + `CATEGORY`.padEnd(14) + `HIGH SCORE`));\n console.log(chalk.gray('─'.repeat(65)));\n\n const activeGames = Object.values(ALL_GAMES_METADATA).filter((g) => g.id !== 'level-devil');\n for (const game of activeGames) {\n const high = profile.highScores[game.id] || 0;\n console.log(\n chalk.cyan(game.id.padEnd(18)) +\n chalk.whiteBright(game.name.padEnd(20)) +\n chalk.magenta(game.category.padEnd(14)) +\n chalk.yellow(high.toString())\n );\n }\n console.log(`\\n${chalk.gray('Run')} ${chalk.cyan('npx terminull-arcade play <game-id>')} ${chalk.gray('to launch directly.')}\\n`);\n });\n\nprogram\n .command('play <game-id>')\n .description('Launch a game directly by ID')\n .option('-d, --difficulty <level>', 'Difficulty: easy, normal, hard, insane', 'normal')\n .action(async (gameId: string, options: { difficulty: string }) => {\n const validDiff: DifficultyLevel = ['easy', 'normal', 'hard', 'insane'].includes(options.difficulty)\n ? (options.difficulty as DifficultyLevel)\n : 'normal';\n\n let targetGameId = gameId as GameId;\n if (gameId === 'space-invaders') {\n targetGameId = 'void-invaders';\n } else if (gameId === 'matrix' || gameId === 'hacker' || gameId === 'hash') {\n targetGameId = 'hash-matrix';\n } else if (gameId === 'dino' || gameId === 'chrome-dino' || gameId === 'jumping-dino' || gameId === 'trex') {\n targetGameId = 'cyber-dino';\n } else if (gameId === 'devil' || gameId === 'level-devil' || gameId === 'rage') {\n targetGameId = 'level-devil';\n } else if (gameId === 'breakout' || gameId === 'cyber-breakout' || gameId === 'arkanoid' || gameId === 'bricks') {\n targetGameId = 'cyber-breakout';\n } else if (gameId === '2048' || gameId === 'cyber-2048' || gameId === 'matrix-2048' || gameId === 'tile-2048') {\n targetGameId = 'cyber-2048';\n } else if (gameId === 'tower' || gameId === 'stack' || gameId === 'cyber-tower' || gameId === 'tower-stacker' || gameId === 'tower-builder') {\n targetGameId = 'cyber-tower';\n } else if (gameId === 'hopper' || gameId === 'frogger' || gameId === 'byte-hopper' || gameId === 'bytehopper') {\n targetGameId = 'byte-hopper';\n } else if (gameId === 'sweeper' || gameId === 'minesweeper' || gameId === 'cyber-sweeper' || gameId === 'mines') {\n targetGameId = 'cyber-sweeper';\n } else if (gameId === 'flap' || gameId === 'flappy' || gameId === 'neon-flap' || gameId === 'bit-flap') {\n targetGameId = 'neon-flap';\n }\n\n if (targetGameId === 'level-devil') {\n console.log(chalk.yellowBright('\\nNotice: \"level-devil\" is currently disabled from the active CLI roster.\\n'));\n process.exit(0);\n }\n\n if (!ALL_GAMES_METADATA[targetGameId]) {\n console.error(chalk.redBright(`\\nError: Unknown game ID \"${gameId}\".`));\n console.log(`Run ${chalk.cyan('npx terminull-arcade list')} to view valid game IDs.\\n`);\n process.exit(1);\n }\n\n if (!defaultEngine.getRegisteredGames().includes(targetGameId)) {\n console.error(chalk.yellowBright(`\\nNotice: \"${gameId}\" implementation is staged in pipeline.`));\n console.log(`Currently playable games: ${chalk.cyan(defaultEngine.getRegisteredGames().join(', '))}\\n`);\n process.exit(0);\n }\n\n const meta = ALL_GAMES_METADATA[targetGameId]!;\n await playArcadeLoadingScreen(meta, defaultRenderer, defaultStorage);\n\n defaultEngine.launchGame(targetGameId, validDiff, {\n onQuitToMenu: () => {\n launchInteractiveMenu();\n },\n });\n });\n\nprogram\n .command('stats')\n .description('Display career statistics and achievements')\n .action(() => {\n const profile = defaultStorage.getProfile();\n const stats = defaultAchievements.getTotalStats();\n\n let totalScore = 0;\n let totalPlays = 0;\n let totalSec = 0;\n\n for (const id of Object.keys(ALL_GAMES_METADATA)) {\n totalScore += profile.highScores[id] || 0;\n totalPlays += profile.playCounts[id] || 0;\n totalSec += profile.totalTimePlayedSec[id] || 0;\n }\n\n console.log(`\\n${chalk.cyanBright.bold('=== TERMINULL PILOT TELEMETRY ===')}\\n`);\n console.log(`${chalk.gray('Cumulative High Score:')} ${chalk.yellowBright(totalScore.toLocaleString())}`);\n console.log(`${chalk.gray('Total Play Sessions:')} ${chalk.cyanBright(totalPlays)}`);\n console.log(`${chalk.gray('Total Time in Engine:')} ${chalk.magentaBright(formatTime(totalSec))}`);\n console.log(`${chalk.gray('Achievements Unlocked:')} ${chalk.greenBright(`${stats.unlockedCount} / ${stats.totalCount} (${stats.percentage}%)`)}`);\n console.log(`${chalk.gray('Current Active Theme:')} ${chalk.whiteBright(profile.settings.theme)}`);\n console.log(`${chalk.gray('Profile Path:')} ${chalk.gray(defaultStorage.getProfilePath())}\\n`);\n });\n\nprogram\n .command('reset')\n .description('Reset local high scores, achievements, and stats')\n .option('-f, --force', 'Force reset without confirmation prompt')\n .action(() => {\n defaultStorage.resetProfile();\n console.log(chalk.greenBright('\\n✓ Terminull local profile, high scores, and achievements have been reset.\\n'));\n });\n\nfunction launchInteractiveMenu(): void {\n const menu = new ArcadeMenu();\n menu.open((selection) => {\n if (selection.action === 'play' && selection.gameId) {\n if (!defaultEngine.getRegisteredGames().includes(selection.gameId)) {\n console.log(chalk.yellowBright(`\\nGame \"${selection.gameId}\" is staged in the pipeline.\\n`));\n process.exit(0);\n }\n defaultEngine.launchGame(selection.gameId, selection.difficulty, {\n onQuitToMenu: () => launchInteractiveMenu(),\n });\n } else {\n process.exit(0);\n }\n });\n}\n\nprogram.parse(process.argv);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,eAAe;AACxB,OAAO,WAAW;AA2ClB,OAAO,cAAc;AApBrB,cAAc,aAAa,cAAc,MAAM,IAAI,cAAc,CAAC;AAClE,cAAc,aAAa,eAAe,MAAM,IAAI,eAAe,CAAC;AACpE,cAAc,aAAa,iBAAiB,MAAM,IAAI,iBAAiB,CAAC;AACxE,cAAc,aAAa,eAAe,MAAM,IAAI,eAAe,CAAC;AAEpE,cAAc,aAAa,cAAc,MAAM,IAAI,cAAc,CAAC;AAClE,cAAc,aAAa,kBAAkB,MAAM,IAAI,kBAAkB,CAAC;AAC1E,cAAc,aAAa,cAAc,MAAM,IAAI,cAAc,CAAC;AAClE,cAAc,aAAa,eAAe,MAAM,IAAI,eAAe,CAAC;AACpE,cAAc,aAAa,eAAe,MAAM,IAAI,eAAe,CAAC;AACpE,cAAc,aAAa,iBAAiB,MAAM,IAAI,iBAAiB,CAAC;AACxE,cAAc,aAAa,aAAa,MAAM,IAAI,aAAa,CAAC;AAEhE,IAAM,UAAU,IAAI,QAAQ;AAE5B,QACG,KAAK,kBAAkB,EACvB,YAAY,GAAG,MAAM,WAAW,KAAK,QAAQ,CAAC,MAAM,WAAW,EAAE,EACjE,QAAQ,WAAW;AAKtB,QACG,OAAO,aAAa,gCAAgC,EACpD,OAAO,CAAC,YAA+B;AACtC,MAAI,QAAQ,KAAK;AACf,0BAAsB;AACtB;AAAA,EACF;AAEA,sBAAoB;AACtB,CAAC;AAEH,SAAS,sBAA4B;AACnC,QAAM,cAAc,QAAQ;AAC5B,UAAQ,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,aAAa;AAC5B,UAAQ,IAAI,MAAM,YAAY,oFAA+E,CAAC;AAChH,CAAC;AAEH,SAAS,wBAA8B;AACrC,QAAM,OAAO,IAAI,WAAW;AAC5B,OAAK,KAAK,CAAC,cAAc;AACvB,QAAI,UAAU,WAAW,UAAU,UAAU,QAAQ;AACnD,UAAI,CAAC,cAAc,mBAAmB,EAAE,SAAS,UAAU,MAAM,GAAG;AAClE,gBAAQ,IAAI,MAAM,aAAa;AAAA,QAAW,UAAU,MAAM;AAAA,CAAgC,CAAC;AAC3F,gBAAQ,KAAK,CAAC;AAAA,MAChB;AACA,oBAAc,WAAW,UAAU,QAAQ,UAAU,YAAY;AAAA,QAC/D,cAAc,MAAM,sBAAsB;AAAA,MAC5C,CAAC;AAAA,IACH,OAAO;AACL,cAAQ,KAAK,CAAC;AAAA,IAChB;AAAA,EACF,CAAC;AACH;AAEA,QAAQ,MAAM,QAAQ,IAAI;","names":[]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
-
type GameId = 'packet-man' | 'cyber-viper' | 'void-invaders' | 'hash-matrix' | 'cyber-dino' | 'level-devil' | 'cyber-breakout' | 'cyber-2048' | 'cyber-tower';
|
|
3
|
+
type GameId = 'packet-man' | 'cyber-viper' | 'void-invaders' | 'hash-matrix' | 'cyber-dino' | 'level-devil' | 'cyber-breakout' | 'cyber-2048' | 'cyber-tower' | 'byte-hopper' | 'cyber-sweeper' | 'neon-flap';
|
|
4
4
|
type DifficultyLevel = 'easy' | 'normal' | 'hard' | 'insane';
|
|
5
5
|
type GameCategory = 'arcade' | 'puzzle' | 'strategy' | 'action';
|
|
6
6
|
type ThemeName = 'default' | 'retro-green' | 'neon' | 'minimal' | 'high-contrast';
|
|
@@ -645,14 +645,14 @@ declare class HashMatrixGame implements GameModule {
|
|
|
645
645
|
render(): void;
|
|
646
646
|
}
|
|
647
647
|
|
|
648
|
-
type ObstacleType = 'cactus-small' | 'cactus-double' | 'cactus-triple' | 'pterodactyl-low' | 'pterodactyl-mid' | 'pterodactyl-high';
|
|
648
|
+
type ObstacleType$1 = 'cactus-small' | 'cactus-double' | 'cactus-triple' | 'pterodactyl-low' | 'pterodactyl-mid' | 'pterodactyl-high';
|
|
649
649
|
interface Obstacle {
|
|
650
650
|
id: number;
|
|
651
651
|
x: number;
|
|
652
652
|
y: number;
|
|
653
653
|
width: number;
|
|
654
654
|
height: number;
|
|
655
|
-
type: ObstacleType;
|
|
655
|
+
type: ObstacleType$1;
|
|
656
656
|
wingFrame?: number;
|
|
657
657
|
}
|
|
658
658
|
interface CyberDinoState {
|
|
@@ -1002,5 +1002,221 @@ declare class CyberTowerGame implements GameModule {
|
|
|
1002
1002
|
render(): void;
|
|
1003
1003
|
}
|
|
1004
1004
|
|
|
1005
|
-
|
|
1005
|
+
type LaneType = 'goal' | 'river' | 'safe' | 'road';
|
|
1006
|
+
type ObstacleType = 'car' | 'truck' | 'racer' | 'tractor' | 'log' | 'turtle' | 'long_log';
|
|
1007
|
+
interface LaneObstacle {
|
|
1008
|
+
id: number;
|
|
1009
|
+
x: number;
|
|
1010
|
+
width: number;
|
|
1011
|
+
type: ObstacleType;
|
|
1012
|
+
}
|
|
1013
|
+
interface Lane {
|
|
1014
|
+
row: number;
|
|
1015
|
+
type: LaneType;
|
|
1016
|
+
speed: number;
|
|
1017
|
+
obstacles: LaneObstacle[];
|
|
1018
|
+
obstacleWidth: number;
|
|
1019
|
+
obstacleType: ObstacleType;
|
|
1020
|
+
spacing: number;
|
|
1021
|
+
}
|
|
1022
|
+
interface GoalSocket {
|
|
1023
|
+
index: number;
|
|
1024
|
+
x: number;
|
|
1025
|
+
filled: boolean;
|
|
1026
|
+
}
|
|
1027
|
+
interface ByteHopperState {
|
|
1028
|
+
playerX: number;
|
|
1029
|
+
playerY: number;
|
|
1030
|
+
lives: number;
|
|
1031
|
+
score: number;
|
|
1032
|
+
highScore: number;
|
|
1033
|
+
level: number;
|
|
1034
|
+
timeRemainingSec: number;
|
|
1035
|
+
goalSockets: GoalSocket[];
|
|
1036
|
+
lanes: Lane[];
|
|
1037
|
+
isDying: boolean;
|
|
1038
|
+
deathTicks: number;
|
|
1039
|
+
isGameOver: boolean;
|
|
1040
|
+
isWon: boolean;
|
|
1041
|
+
highestRowReached: number;
|
|
1042
|
+
}
|
|
1043
|
+
|
|
1044
|
+
declare class ByteHopperGame implements GameModule {
|
|
1045
|
+
readonly id = "byte-hopper";
|
|
1046
|
+
readonly metadata: GameMetadata;
|
|
1047
|
+
private config;
|
|
1048
|
+
private renderer;
|
|
1049
|
+
private input;
|
|
1050
|
+
private rng;
|
|
1051
|
+
private gameLoopTimer;
|
|
1052
|
+
private secondTimer;
|
|
1053
|
+
private tickIntervalMs;
|
|
1054
|
+
private nextObstacleId;
|
|
1055
|
+
private speedMultiplier;
|
|
1056
|
+
private baseTimeLimit;
|
|
1057
|
+
private state;
|
|
1058
|
+
private isPaused;
|
|
1059
|
+
private pauseMenuIndex;
|
|
1060
|
+
private showTutorial;
|
|
1061
|
+
private deathMessage;
|
|
1062
|
+
init(config: GameInitConfig): void;
|
|
1063
|
+
start(): void;
|
|
1064
|
+
pause(): void;
|
|
1065
|
+
resume(): void;
|
|
1066
|
+
restart(): void;
|
|
1067
|
+
saveState(): Record<string, unknown>;
|
|
1068
|
+
loadState(saved: Record<string, unknown>): void;
|
|
1069
|
+
getState(): Readonly<ByteHopperState>;
|
|
1070
|
+
handleInputForTest(key: {
|
|
1071
|
+
name: string;
|
|
1072
|
+
}): void;
|
|
1073
|
+
destroy(): void;
|
|
1074
|
+
private clearTimers;
|
|
1075
|
+
private startSecondTimer;
|
|
1076
|
+
private applyDifficulty;
|
|
1077
|
+
private resetGame;
|
|
1078
|
+
private initGoalSockets;
|
|
1079
|
+
private resetPlayerPosition;
|
|
1080
|
+
private initLanes;
|
|
1081
|
+
private createLane;
|
|
1082
|
+
private scheduleNextTick;
|
|
1083
|
+
tick(): void;
|
|
1084
|
+
private triggerDeath;
|
|
1085
|
+
handleHop(dx: number, dy: number): void;
|
|
1086
|
+
private handleWaveCleared;
|
|
1087
|
+
private addScore;
|
|
1088
|
+
private handleInput;
|
|
1089
|
+
render(): void;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
type CellState = 'hidden' | 'revealed' | 'flagged';
|
|
1093
|
+
interface SweeperCell {
|
|
1094
|
+
r: number;
|
|
1095
|
+
c: number;
|
|
1096
|
+
isMine: boolean;
|
|
1097
|
+
state: CellState;
|
|
1098
|
+
adjacentMines: number;
|
|
1099
|
+
exploded?: boolean;
|
|
1100
|
+
}
|
|
1101
|
+
interface CyberSweeperState {
|
|
1102
|
+
grid: SweeperCell[][];
|
|
1103
|
+
rows: number;
|
|
1104
|
+
cols: number;
|
|
1105
|
+
mineCount: number;
|
|
1106
|
+
cursorR: number;
|
|
1107
|
+
cursorC: number;
|
|
1108
|
+
flagsPlaced: number;
|
|
1109
|
+
cellsRevealed: number;
|
|
1110
|
+
isFirstClick: boolean;
|
|
1111
|
+
isGameOver: boolean;
|
|
1112
|
+
isWon: boolean;
|
|
1113
|
+
score: number;
|
|
1114
|
+
elapsedSeconds: number;
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
declare class CyberSweeperGame implements GameModule {
|
|
1118
|
+
readonly id = "cyber-sweeper";
|
|
1119
|
+
readonly metadata: GameMetadata;
|
|
1120
|
+
private config;
|
|
1121
|
+
private renderer;
|
|
1122
|
+
private input;
|
|
1123
|
+
private rng;
|
|
1124
|
+
private timer;
|
|
1125
|
+
private state;
|
|
1126
|
+
private isPaused;
|
|
1127
|
+
private pauseMenuIndex;
|
|
1128
|
+
private showTutorial;
|
|
1129
|
+
init(config: GameInitConfig): void;
|
|
1130
|
+
start(): void;
|
|
1131
|
+
pause(): void;
|
|
1132
|
+
resume(): void;
|
|
1133
|
+
restart(): void;
|
|
1134
|
+
saveState(): Record<string, unknown>;
|
|
1135
|
+
loadState(saved: Record<string, unknown>): void;
|
|
1136
|
+
getState(): Readonly<CyberSweeperState>;
|
|
1137
|
+
handleInputForTest(key: {
|
|
1138
|
+
name: string;
|
|
1139
|
+
}): void;
|
|
1140
|
+
destroy(): void;
|
|
1141
|
+
private startTimer;
|
|
1142
|
+
private stopTimer;
|
|
1143
|
+
private applyDifficulty;
|
|
1144
|
+
private resetGame;
|
|
1145
|
+
private populateMines;
|
|
1146
|
+
private countAdjacentMines;
|
|
1147
|
+
probeCell(r: number, c: number): void;
|
|
1148
|
+
private revealCascade;
|
|
1149
|
+
toggleFlag(r: number, c: number): void;
|
|
1150
|
+
chordCell(r: number, c: number): void;
|
|
1151
|
+
private handleDetonation;
|
|
1152
|
+
private checkWinCondition;
|
|
1153
|
+
private addScore;
|
|
1154
|
+
private handleInput;
|
|
1155
|
+
private formatCell;
|
|
1156
|
+
render(): void;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
interface FlapPipe {
|
|
1160
|
+
id: number;
|
|
1161
|
+
x: number;
|
|
1162
|
+
gapY: number;
|
|
1163
|
+
gapHeight: number;
|
|
1164
|
+
passed: boolean;
|
|
1165
|
+
}
|
|
1166
|
+
interface ThrustParticle {
|
|
1167
|
+
x: number;
|
|
1168
|
+
y: number;
|
|
1169
|
+
life: number;
|
|
1170
|
+
char: string;
|
|
1171
|
+
}
|
|
1172
|
+
interface NeonFlapState {
|
|
1173
|
+
droneY: number;
|
|
1174
|
+
droneVelocityY: number;
|
|
1175
|
+
score: number;
|
|
1176
|
+
highScore: number;
|
|
1177
|
+
conduitsPassed: number;
|
|
1178
|
+
perfectPasses: number;
|
|
1179
|
+
streak: number;
|
|
1180
|
+
pipes: FlapPipe[];
|
|
1181
|
+
particles: ThrustParticle[];
|
|
1182
|
+
isGameOver: boolean;
|
|
1183
|
+
isFlapping: boolean;
|
|
1184
|
+
flapCooldown: number;
|
|
1185
|
+
distanceTraveled: number;
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
declare class NeonFlapGame implements GameModule {
|
|
1189
|
+
readonly id = "neon-flap";
|
|
1190
|
+
readonly metadata: GameMetadata;
|
|
1191
|
+
private config;
|
|
1192
|
+
private renderer;
|
|
1193
|
+
private input;
|
|
1194
|
+
private rng;
|
|
1195
|
+
private gameLoopTimer;
|
|
1196
|
+
private nextPipeId;
|
|
1197
|
+
private groundOffset;
|
|
1198
|
+
private state;
|
|
1199
|
+
private isPaused;
|
|
1200
|
+
private pauseMenuIndex;
|
|
1201
|
+
private showTutorial;
|
|
1202
|
+
private settings;
|
|
1203
|
+
init(config: GameInitConfig): void;
|
|
1204
|
+
private resetState;
|
|
1205
|
+
private spawnPipe;
|
|
1206
|
+
start(): void;
|
|
1207
|
+
destroy(): void;
|
|
1208
|
+
restart(): void;
|
|
1209
|
+
tick(): void;
|
|
1210
|
+
flap(): void;
|
|
1211
|
+
private checkCollision;
|
|
1212
|
+
private triggerGameOver;
|
|
1213
|
+
private checkAchievements;
|
|
1214
|
+
private scheduleNextTick;
|
|
1215
|
+
private handleInput;
|
|
1216
|
+
render(): void;
|
|
1217
|
+
getState(): NeonFlapState;
|
|
1218
|
+
setState(partial: Partial<NeonFlapState>): void;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
export { ALL_GAMES_METADATA, APP_NAME, APP_TAGLINE, APP_VERSION, AchievementManager, ArcadeMenu, ByteHopperGame, ByteRunnerGame, Cyber2048Game, CyberBreakoutGame, CyberDinoGame, CyberSweeperGame, CyberTowerGame, CyberViperGame, DeterministicRNG, HashMatrixGame, LevelDevilGame, MIN_TERMINAL_COLUMNS, MIN_TERMINAL_ROWS, NeonCircuitGame, NeonFlapGame, PacketManGame, StorageManager, THEMES, TerminalInputHandler, TerminalRenderer, TerminullEngine, UserProfileSchema, UserSettingsSchema, VoidInvadersGame, checkTerminalDimensions, clamp, defaultAchievements, defaultEngine, defaultRenderer, defaultStorage, formatTime, getTheme, padRightVisible, playArcadeLoadingScreen, playTerminalBell, stripAnsi, visibleLength, wordWrap };
|
|
1006
1222
|
export type { Achievement, ColorPalette, DifficultyLevel, EngineEvents, GameCategory, GameId, GameInitConfig, GameMetadata, GameModule, KeyBinding, KeyPressHandler, MenuSelection, RenderHeaderOptions, ThemeName, UnlockedEvent, UserProfile, UserSettings };
|
package/dist/index.js
CHANGED
|
@@ -6,15 +6,18 @@ import {
|
|
|
6
6
|
APP_VERSION,
|
|
7
7
|
AchievementManager,
|
|
8
8
|
ArcadeMenu,
|
|
9
|
+
ByteHopperGame,
|
|
9
10
|
Cyber2048Game,
|
|
10
11
|
CyberBreakoutGame,
|
|
11
12
|
CyberDinoGame,
|
|
13
|
+
CyberSweeperGame,
|
|
12
14
|
CyberTowerGame,
|
|
13
15
|
CyberViperGame,
|
|
14
16
|
DeterministicRNG,
|
|
15
17
|
HashMatrixGame,
|
|
16
18
|
MIN_TERMINAL_COLUMNS,
|
|
17
19
|
MIN_TERMINAL_ROWS,
|
|
20
|
+
NeonFlapGame,
|
|
18
21
|
PacketManGame,
|
|
19
22
|
StorageManager,
|
|
20
23
|
THEMES,
|
|
@@ -38,7 +41,7 @@ import {
|
|
|
38
41
|
stripAnsi,
|
|
39
42
|
visibleLength,
|
|
40
43
|
wordWrap
|
|
41
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-Z5UIN4FP.js";
|
|
42
45
|
|
|
43
46
|
// src/games/neon-circuit/index.ts
|
|
44
47
|
var NeonCircuitGame = class {
|
|
@@ -1741,10 +1744,12 @@ export {
|
|
|
1741
1744
|
APP_VERSION,
|
|
1742
1745
|
AchievementManager,
|
|
1743
1746
|
ArcadeMenu,
|
|
1747
|
+
ByteHopperGame,
|
|
1744
1748
|
ByteRunnerGame,
|
|
1745
1749
|
Cyber2048Game,
|
|
1746
1750
|
CyberBreakoutGame,
|
|
1747
1751
|
CyberDinoGame,
|
|
1752
|
+
CyberSweeperGame,
|
|
1748
1753
|
CyberTowerGame,
|
|
1749
1754
|
CyberViperGame,
|
|
1750
1755
|
DeterministicRNG,
|
|
@@ -1753,6 +1758,7 @@ export {
|
|
|
1753
1758
|
MIN_TERMINAL_COLUMNS,
|
|
1754
1759
|
MIN_TERMINAL_ROWS,
|
|
1755
1760
|
NeonCircuitGame,
|
|
1761
|
+
NeonFlapGame,
|
|
1756
1762
|
PacketManGame,
|
|
1757
1763
|
StorageManager,
|
|
1758
1764
|
THEMES,
|