Skip to content
/ es6-boilerplate Public template

ES6 Vite Boilerplate for melonJS

License

Notifications You must be signed in to change notification settings

melonjs/es6-boilerplate

Repository files navigation

melonJS ES6 Vite Boilerplate

melonJS Logo

License: MIT

A simple ES6 Vite based boilerplate to create games with melonJS, built with :

Prerequisites

Ensure you have Node.js installed, then install all the build dependencies in the folder where you cloned the repository :

$ [sudo] npm install

Usage

  • npm run dev to start the dev server on watch mode at localhost:5173.
  • npm run build to generate a minified, production-ready build, in the public folder

if everything goes well, on running the dev server for the first time you should see this : boilerplate-helloworld

Folder structure

src
└── data
│    ├── bgm
│    ├── fnt
|    ├── img
|    ├── map
|    └── sfx
└── js
|    ├── renderables
|    └── stage
├── index.js
├── index.css
├── index.html
├── manifest.js
public
├── data
├── bundle.js
└── index.html
  • src
    • the root folder for your game source code
    • The entry file is index.js.
    • index.css and index.html are default templates that can be customized
    • manifest.js is a list of asset to be preloaded by melonJS
  • src/js
    • add your source classes here
  • src/data
    • where to add your game assets
  • public
    • where the production-ready build files will be copied/generated when using npm run build

Debug plugin

The boilerplate include the melonJS plugin, and will automatically import and instantiate it when running under a development environement.

the Debug Panel is hidden by default and can be displayed using the "S" key, see here for more details about the plugin.

Questions, need help ?

If you need technical support, you can contact us through the following channels :

  • Forums: with melonJS 2 we moved to a new discourse forum, but we can still also find the previous one here
  • Chat: come and chat with us on discord
  • we tried to keep our wikipage up-to-date with useful links, tutorials, and anything related melonJS.