Overview
The Top-Down Phaser Game with React UI Template is a project based on a Medium post and is built using Create React App and Phaser 3 for the game engine. It incorporates state management with Zustand and has a UI built with Material UI and React 18. The template also utilizes functional programming style, arcade physics, and automatically resizes the game to fit the browser window. It includes features such as a dialog system, game menu, and virtual gamepad for mobile devices. The template comes with pre-loaded assets from Kenney.nl and is licensed under the MIT License.
Features
- Built with Create React App
- Uses Phaser 3 for game engine
- State management with Zustand
- UI with Material UI and React 18
- CSS Modules
- Functional programming style
- Arcade physics
- Automatically resizes game to fit browser window
- Automatically loads Tilesets and assets
- Generates atlas sheets with included script
- Adjustable tile sizes
- Integrates Phaser and React through Zustand
- Dialog system (React-based)
- Game menu (React-based)
- Virtual Gamepad for mobile devices (React-based)
- Includes 2D assets from Kenney.nl
Installation
To use the Top-Down Phaser Game with React UI Template, follow these steps:
- Clone or download the template from the GitHub repository.
- Install the required dependencies by running
npm installoryarn installin the project directory. - Add your game scenes to the
/src/assets/games/scenesdirectory. - Customize the game settings and scenes in the project files.
- Add your Tiled tilesets JSON and images to
/src/assets/tilesetsand your Tiled maps to/src/assets/maps. - Load other assets such as images, fonts, or atlases by calling the
LoadAssetsScenewith the appropriate parameters. - Customize the
GameScenefile to render the game map, items, enemies, etc. - Run the game by using the command
npm startoryarn start.
Summary
The Top-Down Phaser Game with React UI Template is a versatile template that combines the power and flexibility of React and Phaser to create top-down games with a user-friendly UI. With features such as state management, functional programming style, and integration with Material UI and Zustand, developers can easily customize and extend the template to build their own games. The availability of pre-loaded assets from Kenney.nl and the support for mobile devices through the virtual gamepad make it even more convenient for creating cross-platform games. Overall, this template provides a solid foundation for developing top-down games with React and Phaser.