All Projects → burnoutjs → Burnoutjs

burnoutjs / Burnoutjs

Licence: mit
🎮 2D game engine for manage collisions. Made with javascript and CSS Grid Layout.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Burnoutjs

Pixelvision8
Pixel Vision 8's core philosophy is to teach retro game development with streamlined workflows. PV8 is also a platform that standardizes 8-bit fantasy console limitations built on top of the open-source C# game engine based on MonoGame.
Stars: ✭ 773 (+1617.78%)
Mutual labels:  game-development, game-engine
Rengfx
lightweight, expressive, extensible 2D/3D game engine
Stars: ✭ 41 (-8.89%)
Mutual labels:  game-development, game-engine
Yage
Simple game engine, written in C++
Stars: ✭ 7 (-84.44%)
Mutual labels:  game-development, game-engine
Engine
Fast and lightweight JavaScript game engine built on WebGL and glTF
Stars: ✭ 6,890 (+15211.11%)
Mutual labels:  game-development, game-engine
Ktx
LibKTX: Kotlin extensions for LibGDX games and applications
Stars: ✭ 913 (+1928.89%)
Mutual labels:  game-development, game-engine
Qengine
Retro game engine for developers that enjoy creating games like it's 1997.
Stars: ✭ 763 (+1595.56%)
Mutual labels:  game-development, game-engine
Excalibur
🎮 An easy to use 2D HTML5 game engine written in TypeScript
Stars: ✭ 892 (+1882.22%)
Mutual labels:  game-development, game-engine
Gameproject3
游戏服务器框架,网络层分别用SocketAPI、Boost Asio、Libuv三种方式实现, 框架内使用共享内存,无锁队列,对象池,内存池来提高服务器性能。还包含一个不断完善的Unity 3D客户端,客户端含大量完整资源,坐骑,宠物,伙伴,装备, 这些均己实现上阵和穿戴, 并可进入副本战斗,多人玩法也己实现, 持续开发中。
Stars: ✭ 655 (+1355.56%)
Mutual labels:  game-development, game-engine
Dodgem
A Simple Multiplayer Game, built with Mage Game Engine.
Stars: ✭ 12 (-73.33%)
Mutual labels:  game-development, game-engine
Lantern
(DEPRECATED, SEE README)
Stars: ✭ 12 (-73.33%)
Mutual labels:  game-development, game-engine
Avg Core
A Future-oriented Adventure Game Framework based on React & Pixi.js. Docs: https://avgjs.github.io/docs/
Stars: ✭ 740 (+1544.44%)
Mutual labels:  game-development, game-engine
Sparky
Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Stars: ✭ 959 (+2031.11%)
Mutual labels:  game-development, game-engine
Ursina
A game engine powered by python and panda3d.
Stars: ✭ 730 (+1522.22%)
Mutual labels:  game-development, game-engine
Coffee
An opinionated 2D game engine for Rust
Stars: ✭ 771 (+1613.33%)
Mutual labels:  game-development, game-engine
Acl
Animation Compression Library
Stars: ✭ 716 (+1491.11%)
Mutual labels:  game-development, game-engine
Awesome Gideros
A curated list of awesome Gideros resources, classes and tips.
Stars: ✭ 17 (-62.22%)
Mutual labels:  game-development, game-engine
Ouzel
C++ game engine for Windows, macOS, Linux, iOS, tvOS, Android, and web browsers
Stars: ✭ 607 (+1248.89%)
Mutual labels:  game-development, game-engine
Grid Sdk
The Grid SDK - Game engine for Lua
Stars: ✭ 612 (+1260%)
Mutual labels:  game-development, game-engine
Acid
A high speed C++17 Vulkan game engine
Stars: ✭ 838 (+1762.22%)
Mutual labels:  game-development, game-engine
Donerserializer
A C++14 JSON Serialization Library
Stars: ✭ 31 (-31.11%)
Mutual labels:  game-development, game-engine

burnout.js logologo

burnout.js

🎮 The 2D game engine for manage collisions. Made with javascript and CSS Grid Layout. 💓

Features

  • Grid based map (Powered by Grid Layout API).
  • Create and position blocks in the map (Following the Grid Layout API).
  • Create an avatar for playing the game.
  • Set different styles for all avatar sides.
  • Register blocks for collisions with avatar (with configurable callbacks).
  • Register blocks for avatar over (with configurable callbacks).
  • Set multiple type of controls using plugins.
  • Developer mode for easily style the map.
  • Easily access to map, view, avatar and blocks DOM references.

How to use?

Install

Tip: Verify if you have node and yarn installed.

$ yarn add burnoutjs

Setup

ES6/ECMAScript 2015 module:

Tip: Use Webpack (or similar module bundler) to manage the components.

import burnout from 'burnoutjs';

CommonJS module:

Tip: Use Browserify (or similar module bundler) to manage the components.

const burnout = require('burnoutjs');

Create you game

1 - Define your map:

burnout.defineMap({
  developer: true,
  blockSize: 10,
  map: {
    cols: 30,
    rows: 30,
  },
  view: {
    cols: 15,
    rows: 15,
  },
});

2 - Create as many blocks as you like:

A simple block

burnout.defineBlock({
  className: 'block',
  position: {
    rowStart: 20,
    columnStart: 20,
    rowEnd: 21,
    columnEnd: 21,
  }
});

A block with collision and callback action

burnout.defineBlock({
  className: 'wall',
  collision: true,
  position: {
    rowStart: 20,
    columnStart: 20,
    rowEnd: 21,
    columnEnd: 21,
    action: blockPosition => {
      console.log(blockPosition);
    },
  }
});

A block with over and callback action

burnout.defineBlock({
  className: 'grass',
  over: true,
  position: {
    rowStart: 20,
    columnStart: 20,
    rowEnd: 21,
    columnEnd: 21,
    action: blockPosition => {
      console.log(blockPosition);
    },
  }
});

A block with interaction (with a() button) and callback action

burnout.defineBlock({
  className: 'grass',
  interaction: true,
  position: {
    rowStart: 20,
    columnStart: 20,
    rowEnd: 21,
    columnEnd: 21,
    action: blockPosition => {
      console.log(blockPosition);
    },
  }
});

3 - Define your avatar.

burnout.defineAvatar({
  className: 'player',
  side: {
    up: 'player--up',
    down: 'player--down',
    left: 'player--left',
    right: 'player--right',
  },
  position: {
    rowStart: 7,
    columnStart: 7,
    rowEnd: 8,
    columnEnd: 8,
  },
  static: false,
});

4 - Set all game controls.

Install a plugin for manage controls:

$ yarn add burnout-keyboard-controls-plugin

Import the plugin:

import keyboardControlsPlugin from 'burnout-keyboard-controls-plugin';

Use:

burnout.defineControlsPlugin(keyboardControlsPlugin);

5 - Render the game in the DOM.

const container = document.getElementById('anyDomElement');
burnout.renderMap(container);

Result (with a collision block):

Collision example with keyboard controls:

Game demo

  • Red border: Camera/view of the game.
  • Black border: All game map.
  • Purple block: The avatar controlled via keyboard.
  • Green block: A single block for collision.

More features

burnout.getMap();
burnout.getView();
burnout.getAvatar();
burnout.getBlock({
  rowStart: 10,
  columnStart: 10,
  rowEnd: 11,
  columnEnd: 11,
});

Development

Getting started

Clone this repository and install its dependencies:

$ git clone https://github.com/burnoutjs/burnoutjs.git
$ cd burnoutjs
$ yarn

Build

Builds the library to dist:

$ yarn build

Builds the library, then keeps rebuilding it whenever the source files change using rollup-watch:

$ yarn dev

Code Style

Follow the JS Code Style Guide by Afonso Pacifer.

All code style are automatic validate with ESLint:

Tests

Run all unit tests:

$ yarn test

Versioning

To keep better organization of releases we follow the Semantic Versioning 2.0.0 guidelines.

Contributing

Want to contribute? Follow these recommendations.

History

See Releases for detailed changelog.

License

MIT License © Afonso Pacifer

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].