A project by Romantic Draculla.
- 3D graphics using Three.js
- Entity Component System (ECS) architecture for game logic
- Immutable state management with Immer
- Keyboard input handling for interactive elements
- TypeScript for type safety and improved developer experience
- Vite for fast development and optimized builds
- GitHub Actions for CI/CD and GitHub Pages deployment
- ESLint for code quality
- Vitest for testing
/
├── src/ # Source files
│ ├── assets/ # Game assets (images, sounds, etc.)
│ ├── lib/ # Core game engine components
│ │ ├── systems/ # ECS systems (movement, rendering, input)
│ │ ├── ecs.ts # Entity Component System implementation
│ │ └── components.ts # Component definitions
│ ├── utils/ # Utility functions
│ ├── game.ts # Main game setup and loop
│ ├── style.css # Global styles
│ └── dummy.test.ts # Example test file
├── public/ # Static assets served as-is
├── .github/workflows/ # GitHub Actions CI/CD
├── index.html # HTML entry point
├── vite.config.ts # Vite configuration
├── tsconfig.json # TypeScript configuration
└── package.json # Project dependencies and scripts
The application is built using an Entity Component System (ECS) architecture:
- Entities: Game objects represented by unique IDs
- Components: Data structures attached to entities (Position, Velocity, etc.)
- Systems: Logic that operates on entities with specific component combinations
The game loop processes these systems in sequence each frame:
- Input System - Handles keyboard controls
- Movement System - Updates positions based on velocities
- Render System - Updates Three.js meshes based on entity positions
- Node.js (v20 or higher recommended)
- pnpm (v8.15.3 or higher recommended)
- Clone the repository
- Install dependencies:
pnpm installStart the development server:
pnpm devThis will start the development server on the default Vite port.
Build the project for production:
pnpm buildThe built assets will be in the dist directory.
Preview the production build locally:
pnpm previewRun ESLint to check code quality:
pnpm lintRun tests with Vitest:
pnpm testThe project includes GitHub Actions workflows that will automatically deploy your application to GitHub Pages when you push to the main branch.
You can also manually deploy using:
pnpm deployUse the arrow keys to move the cube:
- Up Arrow: Move forward
- Down Arrow: Move backward
- Left Arrow: Move left
- Right Arrow: Move right
This project is licensed under the MIT License - see the LICENSE file for details.