Life.JS is a web 2D Pure, Extensible and Animated JavaScript Game Engine written in Pure JavaScript in 2022.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
- ✅ Added the new GameLoop class, instead of
setInterval
orrequestAnimationFrame
, you can use it for cross-browser compatibility, easier use and customizable FPS. - ✅ Added full mouse control.
- ✅ Added Exported Constants like
Shapes, Cursors, Patterns, Events
. - ✅ Fixed some Intellisense issues.
- ✅ Added Event emitters, and listeners to objects that are similar to DOM Events.
- ✅ V1.1.0: Fixed World Limits
- ✅ Added Playground! 🎮
-
⛔ Temporarily disabled Shape Object rotation due to some visual issues, it will be fixed asap. -
✅ Fixed Shape Object Rotation.
-
⛔ Temporarily disabled Shape Flipping due to some visual issues, it will be fixed asap. -
✅ Fixed Shape Flipping at different axis.
LifeJS is a JavaScript Library to make 2D Animated Browser games with a highly flexible API.
-
It works by creating instances of pre-given classes and saving their geopositions, dimensions in the object class itself. Then calling a function that draws the shape for each registered shape in the previously created world instance.
-
It was written by a 17 years old developer from Algeria 🇩🇿 for web game developement purpose., his name is Ramy Hadid.
-
It's creation story, was that the developer was looking for developing a small browser game, he was then looking for game engines and libraries... Then noticed that all libraries have a complex to use API, he decided to make his own small Idea for making small 2D games, after a long time, this idea turned to be LifeJS.
Most developers choose us because of the Following Reasons:
- Maximum-minimalist code.
- Full Cross-Browser support.
- Flexible & Full featured GEF (Game Engine Framework).
- Processing Speed and Organization.
🌿 NodeJS (for intellisence) :
npm install -g life.js # COMING SOON...
import { World, Shape } from 'path/to/life.js';
var world = new World ({ ... });
const { World, Shape } = require('life.js'); // ESM
import { World as Level, Shape } from 'life.js' // TS
Life.min.js ― Minimal Version • 17kb
Life.js ― Classic Version (Not minimized) • 33kb
import { World, Shape, GameLoop } from 'path/to/life.js'
// Rotating Centered Square...
const world = new World();
const square = new Shape({
type: 'rectangle',
width: 80,
height: 80,
pattern: 'color',
background: 'cyan'
});
world.center(square) // • Make the square centered in the Screen.
const FPS = 60;
function main() {
world.update(); // • Update The World on each Frame.
square.rotate(1); // • Rotate the Square.
}
const game = new GameLoop(main, FPS);
game.start();
See? As simple as that.
You can check LifeJS documentation here (GitHub).
You can check LifeJS Application Programming Interface (API) here (GitHub).
Copyright (c) 2022 LifeJS (https://www.github.com/rhpo/life.js) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
• Email ― lifejs@ramey.ml
• Phone Number ― +213 553 23 84 10
• Discord ― (Life.JS ― Gaming in JavaScript)
• Name ― Ramy Hadid.
• Age ― 17 Years old.
• Nationality ― 🇩🇿 Algeria.
• Linkedin ― (Ramy Hadid)
• Instagram ― @ramyhadid
• Discord ― ramy#1539
• GitHub ― @rhpo
• Email ― me@ramey.ml
• Programming Languages ― C# • Ruby • NodeJS • Julia.
Written by @rhpo with ❤️.