Welcome to the Phaser 3 TypeScript Starter Template! This template provides a ready-to-use setup for developing Phaser games using TypeScript. Follow the steps below to get started:
Clone the repository to your local machine by running the following command in your terminal:
git clone https://github.com/rishav-jha-mech/Phaser-Typescript-Template.git
Navigate to the cloned repository directory and install all the necessary packages using npm:
cd Phaser-Typescript-Template
npm install
After installing the dependencies, you can build and run the project. This command will compile your TypeScript files into JavaScript and start a development server that watches for changes:
npm start
Now you can run your public/index.html file using live server.
Feel free to modify and customize the template according to your project requirements. Here are some suggestions:
-
Game Development: Start building your game by adding assets (images, sounds, etc.) to the assets directory and writing your game logic in TypeScript files under the src directory.
-
Webpack Configuration: Adjust the webpack configuration (webpack.config.js) to suit your project's needs. You can customize entry points, output paths, and other webpack settings as necessary.
-
Phaser Configuration: Modify the Phaser configuration in src/app.ts to set up your game's initial settings, such as the canvas size, physics settings, and more.
-
tsconfig.json: You can modify the tsconfig.json file to adjust TypeScript compiler options according to your project requirements.
-
Prettier and Husky Hooks: We use Prettier for code formatting and Husky for pre-commit hooks. Both can be customized by modifying the .prettierrc file and the husky configuration in package.json, respectively.
If you encounter any issues or have suggestions for improvements, feel free to open an issue or submit a pull request on GitHub.
Happy game development! ๐๐ฎ