A multiplayer social deduction game where players are crew members aboard a decaying deep-space colony ship. Work together to complete critical repairs while "Decayers" secretly sabotage systems and spread entropy throughout the ship.
You're part of a failing colony ship's crew with critical systems breaking down. Complete tasks to stabilize the ship before the Entropy Meter maxes out and destroys everyone. But beware - some crew members have mutated into Decayers who accelerate decay and eliminate the crew.
- Tasks: Repair power systems, decontaminate food supplies, reroute oxygen
- Decay System: Rooms visually deteriorate - lighting fails, mold spreads, panels fall off
- Entropy Meter: Global countdown to ship destruction
- Infected Rooms: Staying too long causes vision blur, slower tasks, hallucinations
- Spores: Decayers plant spores to corrupt tasks and infect players
- Emergency Meetings: Vote out suspected Decayers, but decay affects communication
- Crew Wins: Repair critical systems and jettison infected zones OR eliminate all Decayers
- Decayers Win: Max out the entropy meter, infect all players, OR kill enough crew
- NX Monorepo - Project management and build system
- Node.js + Socket.io - Real-time multiplayer backend
- Phaser 3 - Game engine and client rendering
- TypeScript - Shared data models and type safety
apps/
game-client/ # Phaser 3 frontend with integrated lobby
game-server/ # Socket.io multiplayer server
libs/
shared/
game-engine/ # Core game logic
models/ # Data models & interfaces
networking/ # Socket.io events
utils/ # Shared utilities
Phase 1: MVP Core (COMPLETE ✅)
- NX monorepo setup with project.json configuration
- Manager-based architecture implementation
- Multiplayer server with room management
- Phaser 3 client with integrated lobby
- Core task system with interaction detection
- Real-time player movement and synchronization
- Ship layout with maze-like collision system
- 8-directional player animations
Current Focus: Phase 2 - Decay System Implementation
Recent Major Refactoring:
- ✅ Modular manager architecture (RoomManager, GameManager, PlayerManager, etc.)
- ✅ Consolidated single-client architecture (removed separate lobby-web)
- ✅ TypeScript error resolution and DOM API support
- ✅ Proper NX project.json configuration
- ✅ Comprehensive documentation updates
See GAME_PLAN.md for detailed roadmap.
- Node.js (v18 or higher)
- npm or yarn
# Clone the repository
git clone git@github.com:adewitt76/LastLight.git
cd LastLight
# Install dependencies
npm installStart applications:
# Start the game client (Phaser 3 frontend with integrated lobby)
npx nx serve game-client
# Start the game server (Socket.io backend)
npx nx serve game-server
# IMPORTANT: After making changes to shared libraries, sync the workspace
npx nx syncBuild applications:
# Build specific app
npx nx build game-client
npx nx build game-server
# Build all apps
npx nx run-many -t buildRun tests:
# Test specific project
npx nx test game-client
# Test all projects
npx nx run-many -t test
# Lint and typecheck
npx nx run-many -t lint
npx nx run-many -t typecheckThe project uses a modular manager architecture for maintainability and separation of concerns:
Server-Side Managers:
RoomManager- Room lifecycle and player managementGameManager- Game state, task validation, win conditionsSocketHandlers- Socket.io event handling
Client-Side Managers:
ShipLayoutManager- Ship visual layout creationPlayerManager- Player sprites, animations, movementTaskManager- Task system and interaction detectionGameSocketManager- Socket.io client communicationGameUI- User interface managementWallCollisionManager- Physics collision system
- Maintainable: Each manager has a single responsibility
- Testable: Smaller, focused classes are easier to unit test
- Reusable: Managers can be shared across different scenes
- Debuggable: Easier to isolate and fix issues
- Collaborative: Multiple developers can work on different systems
Unlike traditional social deduction games, Last Light features:
- Visual Decay: Watch the ship deteriorate in real-time
- Environmental Hazards: Infected rooms affect gameplay directly
- Entropy Pressure: Global timer creates urgency for all players
- Corruption Mechanics: Spores and hallucinations blur reality
Built for game jams with rapid prototyping in mind while maintaining extensible architecture.