/phaser-skeleton

Primary LanguageJavaScriptMIT LicenseMIT

logo dev in the hood

License Version

jul6art/phaser-skeleton

Base phaser JS game

Requirements

  • nodeJS
  • npm
  • phaser ^3.55

Installation

git clone https://github.com/jul6art/phaser-skeleton.git

Commands

Launch app

npm start

Generate translations

npm run i18n

Build your app

npm build

Project Structure

    .
    ├── dist
    ├── node_modules
    ├── public
    ├── src
    │   ├── HelloWorldScene.js
    │   ├── main.js
	├── index.html
    ├── package.json

JavaScript files are intended for the src folder. main.js is the entry point referenced by index.html.

Other than that there is no opinion on how you should structure your project.

There is an example HelloWorldScene.js file that can be placed inside a scenes folder to organize by type or elsewhere to organize by function. For example, you can keep all files specific to the HelloWorld scene in a hello-world folder.

It is all up to you!

Static Assets

Any static assets like images or audio files should be placed in the public folder. It'll then be served from the root. For example: http://localhost:8000/images/my-image.png

Example public structure:

    public
    ├── images
    │   ├── my-image.png
    ├── music
    │   ├── ...
    ├── sfx
    │   ├── ...

They can then be loaded by Phaser with this.image.load('my-image', 'images/my-image.png').

ESLint

This template uses a basic eslint set up for code linting to help you find and fix common problems in your JavaScript code.

It does not aim to be opinionated.

See here for rules to turn on or off.

Dev Server Port

You can change the dev server's port number by modifying the vite.config.js file. Look for the server section:

{
	// ...
	server: { host: '0.0.0.0', port: 8000 },
}

Change 8000 to whatever you want.

License

The Symfony Skeleton is open-sourced software licensed under the MIT license.

© 2023 dev in the hood