This is a 2D game framework built with TypeScript, following the Entity-Component-System (ECS) architecture and utilizing the Matter.js physics engine. The framework enables the development of 2D games with realistic physics interactions.
ps: I'm just begining in designing this such of thing, so feel free to tell me what i can improve. Also I do it just for fun.
This repo is yet empty cause I'm still learning some concepts before actually re-writting my old code π wait a bit if it happen that you are reading this. IT'S BIT TO HARD π³
-
ECS Architecture: The framework is designed using the Entity-Component-System architecture, which provides a flexible and scalable approach to building game entities and systems. It allows for easy composition of game objects and separation of concerns.
-
TypeScript: The framework is written in TypeScript, bringing the benefits of static typing and enhanced tooling support. TypeScript helps catch errors during development and provides better code maintainability.
-
Vite as Bundler: The framework utilizes Vite as the bundler, offering fast development server with hot module replacement and efficient production builds.
-
Matter.js Physics Engine: The framework integrates the Matter.js physics engine to handle realistic physics simulations in the game. Matter.js provides an efficient and robust physics engine for 2D games, including collision detection and response.
-
Game Loop: The framework includes a game loop implementation that handles rendering, input handling, physics calculations, and updating game entities. It ensures smooth and consistent gameplay experience.
-
Sprite Rendering: The framework supports sprite rendering, allowing for the display of 2D graphics and animations in the game. It provides mechanisms for loading and rendering sprites, as well as managing sprite animations.
-
Input Handling: The framework includes input handling capabilities, allowing for user interaction with the game through keyboard or mouse events. It provides an abstraction layer for easy access to input states and actions.
- Clone the repository:
git clone https://github.com/TsitoUw/2D-game-framework.git
- Navigate to the project directory:
cd game-framework
- Install the dependencies:
npm install
- Start the development server:
npm run dev
- Open your browser and visit:
http://localhost:1080
To deploy your game to a production environment, follow these steps:
- Build the optimized version of the project:
npm run build
- The build output will be located in the
dist
directory. - Deploy the contents of the
dist
directory to your desired hosting platform.
- This project utilizes the following libraries and frameworks:
The game framework is open-source and available under the MIT License. Feel free to modify and use it to develop your own 2D games.
If you have any questions or feedback, please feel free to reach out to me at [email protected].