Skip to content

spencerbaynton/ecs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Entity Component System (ECS)

ecs = require "ecs"

ecs.getEntities

Gets all the Entities with a given component.

ecs.getEntities(component)
  • string component The type of component.

ecs.newEntity

Creates a new Entity.

entity = ecs.newEntity()

Entity

Entity:add

Adds a component and its data to the Entity. Returns the data from the added component.

Entity:add(component, data)
  • string component The type of component.
  • value data The data of the component.

Entity:destroy

Destroys the Entity.

Entity:destroy()

Entity:get

Gets the data for a given component from the Entity.

Entity:get(component)
  • string component The type of component.

Entity:has

Whether the Entity has a given component.

Entity:has(component)
  • string component The type of component.

Entity:remove

Removes the component from the Entity.

Entity:remove(component)
  • string component The type of component.

About

An Entity Component System for LÖVE (love2d)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages