Skip to content

Repository files navigation

Taoro

Contributors Forks Stargazers Issues MIT License


Logo

Taoro

A Open Source library for creating amazing games on the web
Explore the docs »

View Demo · Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

Why Taoro?

Taoro is an engine (and set of libraries) for developing web games. The main difference with other frameworks such as Phaser, Construct, etc. is in its 100% modular approach, allowing any user to rewrite any part of the engine. Simplicity first.

The other thing that I think makes Taoro quite unique is the way it implements ECS by using generator functions to create "tasks" that serve as glue between entities, components and systems while keeping the code simple and succinct.

Entities are just identifiers, Components are instantiated using those ids and Systems are started, stopped and updated by the core.

Example:

export function * Player(game) {
  const transform = new TransformComponent('player')
  const image = new ImageComponent('player', {
    source: game.resources.get('player.png')
  })

  // ... initialize other components ...

  let health = 100

  // task main loop
  while (health > 0) {
    if (game.input.stateOf(0, 'up')) {
      transform.position.y--
    } else if (game.input.stateOf(0, 'down')) {
      transform.position.y++
    }

    // we use yield as a way to interrupt
    // the execution of this task and allow
    // other tasks and other systems to
    // be updated.
    yield
  }

  // when the task is over, we can consider the player
  // entity dead so we can release resources and update other things.

  // ... unregister components ...

  transform.unregister()
  image.unregister()
}

game.scheduler.add(Player(game))

// We can also pass ANY argument to our tasks because
// they're just functions...
game.scheduler.add(Enemy(game, EnemyType.HEAVY, x, y))

(back to top)

Where does the name come from?

Taoro is the name of an old menceyato, a type of territorial division used by the natives of Tenerife, one of the canary islands. The place where I grew up until I moved to Madrid.

(back to top)

Previous works

This is heavily based on a previous (discontinued) project called div.js.

(back to top)

Thanks

(back to top)

Made with ❤️ by AzazelN28

About

Taoro Game Engine

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages