Skip to content

randfur/async-game-engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Async Game Engine

This is a minimal game engine built around JavaScript's async await syntax.

github.io page

Example

import {Game} from 'https://randfur.github.io/async-game-engine/engine/game.js';
import {BasicEntity} from 'https://randfur.github.io/async-game-engine/presets/basic-entity.js';
TODO

Concepts

Jobs

Jobs are async threads of execution that can be stopped at any time and can have child jobs that stop when their parent job stops.

These are spawned via scene.do() or job.do() e.g.:

const exampleJob = scene.do(async job => {
  ...
});

Entities

Entities are a syntactic convenience for creating a job blueprint with its own interface and ready to be reused.

These are spawned via scene.create() or job.create() e.g.:

const exampleEntity = scene.create(ExampleEntity, {run, args});

Components

Components like drawing or collision detection can be registered with jobs and get auto cleaned up when the job stops.

Game

The game engine itself, the root owner of all active jobs.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published