A flexible and modular TypeScript game engine for building 2D games. This engine features scene management, input handling, asset management, and a customizable game loop.
- Scene-based game structure
- Entity-Component system
- Asset management for images and audio
- Input handling
- Collision detection
- Customizable game loop
- Node.js (v12 or higher)
- npm (v6 or higher)
-
Clone the repository:
git clone https://github.com/yourusername/typescript-game-engine.git
-
Navigate to the project directory:
cd typescript-game-engine
-
Install dependencies:
npm install
To run the Space Shooter demo game:
-
Start the development server:
npm start
-
Open your browser and navigate to
http://localhost:4000
To build the project for production:
npm run build
This will create a dist
folder with the compiled files.
To create a new game using this engine:
- Create a new class that extends the
Game
class - Implement the
init()
method to set up your game - Create your game entities by extending the
Entity
class - Use the
Scene
class to manage your game objects - Utilize the
AssetManager
to load and manage your game assets
For a complete example, see the SpaceShooterGame
class in the src/SpaceShooterGame.ts
file.
To generate the documentation:
npm run docs
This will create a docs
folder with the generated documentation.
This project is licensed under the ISC License - see the LICENSE file for details.
- TypeScript team for the excellent language and tooling
- Webpack for the module bundling
- Typedoc for the documentation generation
- Node.js for the runtime environment
- npm for the package manager
- Git for version control
- GitHub for hosting the repository