Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (sudo-play) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
sudo-play
A modular, plugin-based terminal arcade architecture that supports dynamically adding multiple games.
Architecture
src/core: Contains the game engine, UI helpers, state management, and routing logic. It handles the main menu and securely boots game modules.src/games: Contains all individual game plugins. The engine dynamically scans this directory and loads the games.
How to play
npm install
npm run build
npm startFor development without manually building every time:
npm run devAdding a New Game
- Create a new directory inside
src/games/(e.g.,src/games/my-game). - Create an
index.tsfile in that directory. - Export a
GameModuleas the default export.
Example:
import { GameModule, GameContext } from '../../core/types.js';
const myGame: GameModule = {
id: 'my-game',
name: 'My Fun Game',
description: 'A great new game for sudo-play.',
version: '1.0.0',
start: async (context: GameContext) => {
context.ui.printBanner('Welcome to My Fun Game!');
context.ui.printMessage('You are playing the game...');
// Reward the player
context.updateXP(50);
context.ui.printSuccess('You earned 50 XP!');
},
};
export default myGame;Remember:
- Do not mutate the global state directly. Use the methods provided in
GameContext. - Core never imports specific games directly; it discovers them automatically.