Skip to content

xavmcc3/js-game-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Js Engine

A personal game engine developed in JavaScript. Meant for quick prototyping and easy development for smaller games. Documentation and a full release are in progress.

The engine is made up of a modular series of systems that tie into a larger controller. Game objects are identified as Entites and can be extended with for different behaviors. The basic structure functions similar to a heiarchy in a game engine like Unity. Moving over to pixijs for rendering.

It's built on mostly older code from years of building and prototyping games in JavaScript for the web.

Getting Started

Include the main JavaScript file in your HTML header. Use defer to ensure it loads after the page content.

<script src="app.js" defer></script>

A basic game can be created with the following code.

const main = new Scene(() => {
    World.instantiate(new Circle(graphics.view.width/2, graphics.view.height/2));
    World.instantiate(new Agent(graphics.view.width/2, graphics.view.height/2));
});

Scene.load(main);
World.start();

Create new game Entities by extending the Entity class.

Documentation/Systems

Work in progress -- once all code is moved over from a different local system.

Processes

Entities

Input

GamepadHandler

Sequencer

Scenes

Menus

Shaders

Vectors

The rand Function

TO DO

  • clean up the system by defining individual modules that can be added to the engine World
  • Make wrappers for the more convoluted sections
  • Move helper methods to a dedicated class so users don't accidentally hide them with new definitions

About

A simple game engine written in JavaScript for accelerated game prototyping

Topics

Resources

License

Stars

Watchers

Forks

Contributors