Git Product home page Git Product logo

es6-boilerplate's Introduction

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.

es6-boilerplate's People

Contributors

abdellatifahammad avatar obiot avatar t407o avatar wpernath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

es6-boilerplate's Issues

Due to babel changes, boilerplate does not work any longer

If you're trying to run npm run dev with this boilerplate project, you get the following exception:

ERROR in ./node_modules/melonjs/dist/melonjs.module.js 3:9
Module parse failed: Identifier '_set2' has already been declared (3:9)
File was processed with these loaders:

  • ./node_modules/babel-loader/lib/index.js
    You may need an additional loader to handle the result of these loaders.
    | function _set2(target, property, value, receiver) { if (typeof Reflect !== "undefined" && Reflect.set) { _set2 = Reflect.set; } else { _set2 = function set(target, property, value, receiver) { var base = _superPropBase(target, property); var desc; if (base) { desc = Object.getOwnPropertyDescriptor(base, property); if (desc.set) { desc.set.call(receiver, value); return true; } else if (!desc.writable) { return false; } } desc = Object.getOwnPropertyDescriptor(receiver, property); if (desc) { if (!desc.writable) { return false; } desc.value = value; Object.defineProperty(receiver, property, desc); } else { _defineProperty(receiver, property, value); } return true; }; } return _set2(target, property, value, receiver); }
    |

function _set2(target, property, value, receiver, isStrict) { var s = _set2(target, property, value, receiver || target); if (!s && isStrict) { throw new Error('failed to set property'); } return value; }
|
| function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@ ./src/index.js 3:0-106 9:0-14 11:7-17 23:6-29 23:30-45 28:2-12 30:2-20 32:2-16 34:4-13 34:14-24 35:4-13 35:14-24 37:4-17 39:4-16 39:17-27

webpack 5.74.0 compiled with 1 error in 9124 ms

The fix for this is to change babel version, fix webpack.config.js etc. I am going to provide a pull request in a few minutes.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.