All Projects → melonjs → Melonjs

melonjs / Melonjs

Licence: mit
a fresh & lightweight javascript game engine

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects

Projects that are alternatives of or similar to Melonjs

Three.js
JavaScript 3D Library.
Stars: ✭ 78,237 (+2002.58%)
Mutual labels:  webgl, webgl2, webaudio, html5, canvas
Babylon.js
Babylon.js is a powerful, beautiful, simple, and open game and rendering engine packed into a friendly JavaScript framework.
Stars: ✭ 15,479 (+315.99%)
Mutual labels:  game-development, game-engine, webgl, webgl2, webaudio
Engine
Fast and lightweight JavaScript game engine built on WebGL and glTF
Stars: ✭ 6,890 (+85.17%)
Mutual labels:  game-development, game-engine, gamedev, webgl, webgl2
Taro
A lightweight 3D game engine for the web.
Stars: ✭ 345 (-90.73%)
Mutual labels:  webgl, webaudio, html5, canvas
Lazy
Kule Lazy4 / CSS Framework
Stars: ✭ 147 (-96.05%)
Mutual labels:  edge, chrome, firefox, html5
Curtainsjs
curtains.js is a lightweight vanilla WebGL javascript library that turns HTML DOM elements into interactive textured planes.
Stars: ✭ 1,039 (-72.08%)
Mutual labels:  webgl, webgl2, html5, canvas
Gdevelop
🎮 GDevelop is an open-source, cross-platform game engine designed to be used by everyone.
Stars: ✭ 3,221 (-13.44%)
Mutual labels:  game-development, game-engine, gamedev, html5
Alien.js
Future web pattern
Stars: ✭ 141 (-96.21%)
Mutual labels:  webgl, webaudio, html5, canvas
Game
⚔️ An online JavaScript 2D Medieval RPG.
Stars: ✭ 388 (-89.57%)
Mutual labels:  game-development, game-engine, gamedev, canvas
Glas
WebGL in WebAssembly with AssemblyScript
Stars: ✭ 278 (-92.53%)
Mutual labels:  game-development, game-engine, gamedev, webgl
Black
World's fastest HTML5 2D game engine   🛸
Stars: ✭ 174 (-95.32%)
Mutual labels:  game-engine, webaudio, html5, canvas
Phaser
Phaser is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
Stars: ✭ 30,918 (+730.91%)
Mutual labels:  game-development, gamedev, webgl, canvas
Kaetram Open
An open-source 2D HTML5 adventure based off BrowserQuest (BQ).
Stars: ✭ 138 (-96.29%)
Mutual labels:  game-development, game-engine, gamedev, html5
Terasology
Terasology - open source voxel world
Stars: ✭ 3,247 (-12.74%)
Mutual labels:  game-development, game-engine, gamedev
Awesome Haxe Gamedev
Resources for game development on haxe
Stars: ✭ 213 (-94.28%)
Mutual labels:  game-development, game-engine, gamedev
Mxengine
C++ open source 3D game engine
Stars: ✭ 284 (-92.37%)
Mutual labels:  game-development, game-engine, gamedev
Luascript
Lua language support for Godot Engine
Stars: ✭ 240 (-93.55%)
Mutual labels:  game-development, game-engine, gamedev
Atomicgameengine
The Atomic Game Engine is a multi-platform 2D and 3D engine with a consistent API in C++, C#, JavaScript, and TypeScript
Stars: ✭ 2,541 (-31.71%)
Mutual labels:  game-development, game-engine, webgl
Entitas Cpp
Entitas++ is a fast Entity Component System (ECS) C++11 port of Entitas C#
Stars: ✭ 229 (-93.85%)
Mutual labels:  game-development, game-engine, gamedev
Panda3d
Powerful, mature open-source cross-platform game engine for Python and C++, developed by Disney and CMU
Stars: ✭ 3,035 (-18.44%)
Mutual labels:  game-development, game-engine, gamedev

melonJS 2

Build Status Language grade: JavaScript Build Size NPM Package jsDeliver Boss Bounty Badge

A fresh, modern & lightweight HTML5 game engine

melonJS

melonJS 2 is a modern version of the melonJS game engine. It has been rebuilt almost entirely using ES6 class, inheritance and semantic, and is bundled using Rollup to provide modern features such as transpiling and tree-shaking.

Note: migrating an existing project to melonJS 2 (version 10.0 and higher) will definitely break your game (ES6 semantic, no more Jay inheritance, nodeJS event emitter, and no backward compatibility with deprecated legacy APIs), and you might want to read first this small step by step guide on upgrading to melonJS 2. If you are looking at the legacy version (9.x and lower) of melonJS, you can find it here under the legacy branch.

melonJS is open-source, licensed under the MIT License, and actively developed and maintained with the help of a small team of enthusiasts at AltByte in Singapore.

About melonJS

melonJS is a fully featured game engine :

Compatibility

  • Standalone library (does not rely on anything else, except a HTML5 capable browser)
  • Compatible with all major browsers (Chrome, Safari, Firefox, Opera, Edge) and mobile devices

Graphics

  • 2D sprite-based graphic engine
  • Fast WebGL 1 & 2 renderer for desktop and mobile devices with fallback to Canvas rendering
  • High DPI resolution & Canvas advanced auto scaling
  • Sprite with 9-slice scaling option, and animation management
  • built-in effects such as tinting and masking
  • Standard spritesheet, single and multiple Packed Textures support
  • System & Bitmap Text

Sound

  • Web Audio support with spatial audio or stereo panning based on Howler
  • fallback to Multi-channel HTML5 audio for legacy browsers

Physic

  • Polygon (SAT) based collision algorithm for accurate detection and response
  • Fast Broad-phase collision detection using spatial partitioning
  • Collision filtering for optimized automatic collision detection

Input

  • Mouse and Touch device support (with mouse emulation)
  • Device motion & accelerometer support

Level Editor

  • Tiled map format version +1.0 integration for easy level design
    • Uncompressed Plain, Base64, CSV and JSON encoded XML tilemap loading
    • Orthogonal, Isometric and Hexagonal maps (both normal and staggered)
    • Multiple layers (multiple background/foreground, collision and Image layers)
    • Animated and multiple Tileset support
    • Tileset transparency settings
    • Layers alpha and tinting settings
    • Rectangle, Ellipse, Polygon and Polyline objects support
    • Tiled Objects
    • Flipped & rotated Tiles
    • Dynamic Layer and Object/Group ordering
    • Dynamic Entity loading
    • Shape based Tile collision support

Assets

  • Asynchronous asset loading
  • A fully customizable preloader

And Also

  • A state manager (to easily manage loading, menu, options, in-game state)
  • Tween Effects, Transition effects
  • Pooling support for object recycling
  • Basic Particle System
  • nodeJS EventEmitter based event system

Tools integration

Free Texture Packer TexturePacker PhysicsEditor ShoeBox Tiled Cordova

Tools integration and usage with melonJS is documented in our Wiki.

Using melonJS

Basic Hello World Example

import * as me from "https://esm.run/melonjs";

me.device.onReady(function () {
    // initialize the display canvas once the device/browser is ready
    if (!me.video.init(1218, 562, {parent : "screen", scale : "auto"})) {
        alert("Your browser does not support HTML5 canvas.");
        return;
    }

    // add a gray background to the default Stage
    me.game.world.addChild(new me.ColorLayer("background", "#202020"));

    // add a font text display object
    me.game.world.addChild(new me.Text(609, 281, {
        font: "Arial",
        size: 160,
        fillStyle: "#FFFFFF",
        textBaseline : "middle",
        textAlign : "center",
        text : "Hello World !"
    }));
});

Simple hello world using melonJS 9.x or higher

Documentation :

For your first time using melonJS, follow these tutorials :

You may find it useful to skim the overview found at the wiki Details & Usage

When starting your own projects, checkout our es6 boilerplate

Demos

A few demos of melonJS capabilities :

More examples are available here

Download melonJS

The latest builds with corresponding release note are available for direct download here.

Since version 10.0.0 melonJS provides different build options :

build description
melonjs.module.js the ES6 Module (ESM) Bundle
melonjs.module.d.ts typescript declaration file for the ES6 Module (ESM) Bundle
melonjs.js a ES5 UMD Bundle (directly transpiled from the ES6 version)
melonjs.min.js a minified version of the ES5 UMD bundle

Alternatively, the latest version of melonJS can be installed through NPM :

$ npm install melonjs

If you need to import the ES6 module of melonjs (e.g. for Webpack):

$ import * as me from 'melonjs/dist/melonjs.module.js';

Or can simply be added to your html, using jsDeliver content delivery network (CDN) :

<!-- load the ES6 module bundle of melonJS v10.0 -->
<script src="https://esm.run/[email protected]"></script>
<!-- omit the version completely to get the latest one -->
<!-- you should NOT use this in production -->
<script src="https://esm.run/melonjs"></script>

Note: starting from the 10.0.0 version, the debug plugin is no longer provided as part of the melonJS library release, and has been moved to the official boilerplate

Building melonJS

For most users, all you probably want is to use melonJS, and all you need then is just to download the latest built release to get started. The only time you should need to build melonJS is if you want to contribute to the project and start developing on it.

To build your own version of melonJS you will need to install :

  • The Node.js JavaScript runtime and the NPM package manager

Once Node.js and NPM have been installed, you need to install build dependencies, by executing the following in the folder where you cloned the repository :

$ [sudo] npm install

Then build the melonJS source by running:

$ npm run build

The generated library will be available under the build directory :

  • melonjs.js : plain ES5 UMD bundle
  • melonjs.min.js : minified ES5 UMD bundle
  • melonjs.module.js : plain ES6 module

To run the melonJS test suite simply use the following:

$ npm run test

This will run the jasmine spec tests with the output displayed on the shell. Do note that the latest Chrome version is required, as the test unit will run the Browser in a headless mode (in case of failed tests, upgrade your browser).

Building the documentation

Similarly, you can build your own copy of the docs locally by running :

$ npm run doc

The generated documentation will be available in the docs directory

WIP Builds

melonJS uses Travis-CI for automated testing and build uploads. The latest build artifacts can be downloaded from the melonjs-builds bucket.

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

Sponsors

Support the development of melonJS by becoming a sponsor. Get your logo in our README with a link to your site or become a backer and get your name in the BACKERS list. Any level of support is really appreciated and goes a long way !

Melon Gaming

Altbyte Pte Ltd

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].