Giter Site home page Giter Site logo

es6-boilerplate's Introduction

melonJS ES6 Webpack Boilerplate

License: MIT

A simple ES6 Webpack 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:9000.
  • 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

Note: when generating the production build, Webpack will attempt to filter files under the data folder to only copy final assets and ignore project files (e.g. .ftpp project files from Free Texture Packer). If you find your file being wrongly ignore you can easily add the corresponding extension in the webpack.config.js file

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 (these won't be automatically imported and bundled by webpack)
  • 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

In development mode, the boilerplate will automatically register and instantiate the melonJS Debug Plugin debug-panel

the Debug Panel is hidden by default and can be displayed using the "S" key, it will then provide the below information :

  • Amount of objects currently active in the current scene
  • Amount of draws operation
  • Amount of body shape (requires to enable the hitbox checkbox)
  • Amount of bounding box
  • Amount of sprites objects
  • Amount of objects currently inactive in the the object pool
  • Heap/memory usage
  • Frame update time (in ms)
  • Frame draw time (in ms)
  • Current fps rate vs target fps

Note: Heap information requires starting Chrome with --enable-precise-memory-info

Additionally, using the checkbox in the panel it is also possible to draw :

  • Shape and Bounding box for all objects
  • Current velocity vector
  • Quadtree spatial visualization

Questions, need help ?

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

For any other non technical related questions, feel free to also send us an email.

es6-boilerplate's People

Contributors

obiot avatar t407o avatar

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.