This is a template project that combines NextJS and Phaser, providing an easy setup for game development with the power of NextJS and the simplicity of Phaser.
- NextJS for server-side rendering and building web applications
- Phaser for creating interactive games
- Seamless integration of Phaser with NextJS
- Easy setup and configuration
- Customizable project structure
- Node.js (version 18 or higher)
- npm (version 8 or higher) or Yarn
-
Clone the repository:
git clone https://github.com/raythurman2386/phaser-template.git
-
Navigate to the project directory:
cd phaser-template
-
Install the dependencies:
npm install # or yarn install
To start the development server, run the following command:
npm run dev
# or
yarn dev
Open http://localhost:8080 with your browser to see the result.
To build the project for production, run the following command:
npm run build
# or
yarn build
The optimized production build will be generated in the dist
directory.
- The main game code is located in the
src/game
directory. You can modify the game logic, add new scenes, and customize the game as per your requirements. - The NextJS project utilizes the App router, and the Game component is imported from the app/Game directory and rendered within the root page of the App router.
- Static assets such as images, audio files, and game assets should be placed in the
public
directory in the assets folder.
Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.
This project is licensed under the MIT License.