Create Games With JavaScript

A lightweight, Love2D-inspired game engine that brings the simplicity of Lua to the power of JavaScript. Perfect for 2D games, prototypes, and creative coding.

window.love.load = function() {
    // Initialize game assets
    player = {
        x: 100,
        y: 100,
        speed: 200
    };
}

window.love.update =  function(dt) {
    // Game logic goes here
    if (love.keyboard.isDown('d')) {
        player.x += player.speed * dt;
    }
}

window.love.draw = function() {
    // Drawing code
    love.graphics.rectangle('fill', player.x, player.y, 32, 32);
}

Why Choose JS2Love?

Designed with simplicity and performance in mind, our engine provides everything you need to bring your game ideas to life.

Simple API

Inspired by Love2D's elegant design, our API is intuitive and easy to learn with familiar functions like load(), update(), and draw().

Web Native

Built for the web from the ground up. Your games run in browsers with no plugins required, making distribution a breeze.

Modular Design

Use only what you need. The engine is modular, so you can keep your game lightweight by including just the components you use.

Mobile Ready

Touch controls and responsive design built in. Test your game on desktop and it will automatically adapt to mobile devices.

Modern JavaScript

Uses ES6+ features and modern browser APIs. Works seamlessly with your favorite tools like Webpack, Babel, and npm.

Open Source

Free and open source under the MIT license. Contribute, fork, or modify - the engine is yours to build upon.

All you need to make any game

With included modules, you can use to create games like:

Physics

A simple to use 2D physics module.

Physics Sprites Controls

Particle System

Interactive particle effects.

Particles Shaders Interactive

Tilemap Editor (demo)

Create and edit tile-based maps for your games.

Tiles Editor Export

Animation

Add animations with sprite sheet in you character

Animations Graphics Sprites

Get Started in Seconds

Start building your game immediately with our simple setup process. No complex build tools required!

1 Installation

git clone https://github.com/danielmhsouza/JS2Love.git

2 Basic Game Structure


//optional modules
import { physics } from './modules/physics2.js';
import { anim } from './modules/anim.js';
import { particles } from './modules/particles.js';
import { tilemap } from './modules/tilemap.js';

window.love.load = function () {
    //load all you need here
}

window.love.update = function (dt) {
    //update all you need here
}

window.love.draw = function () {
    //draw all you need here
}

// Initialize the game
if (window.love.load) {
    window.love.load();
}

What You'll Need

Development Environment

Any text editor will work, but we recommend:

  • VS Code
  • WebStorm
  • Sublime Text

Learning Resources

Helpful for beginners:

  • Basic JavaScript knowledge
  • Game development concepts
  • Our comprehensive documentation

Optional Tools

Enhance your workflow:

  • Tiled for map editing
  • Aseprite for pixel art
  • Audacity for sound effects

Comprehensive Documentation
(Comming Soon)

Our detailed documentation makes it easy to learn and master JS2Love. Everything is explained with clear examples.

Join Our Community

Connect with other developers, share your games, get help, and contribute to the engine's development.

Discord

Chat with the community in real-time. Get instant help, share your progress, and participate in game jams.

Join Server

GitHub

Contribute to the engine's development. Report issues, suggest features, or submit pull requests.

View Repository

Youtube

Longer discussions, tutorials, and showcases. A great place for in-depth conversations about game development.

Visit Channel

Ready to Start Building?

Join thousands of developers creating amazing games with JS2Love. It's free, open source, and waiting for your creativity.