Git Product home page Git Product logo

taoro's Introduction

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

taoro's People

Contributors

azazeln28 avatar

Stargazers

 avatar

Watchers

 avatar Alejandro avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.