crystal.Component

Base class to inherit from to define components.

Methods

Name Description
entity Returns the Entity this component belongs to.

Examples

local Health = Class("Health", crystal.Component);
Health.init = function(self, value)
  self.value = value;
end

local Dragon = Class("Dragon", crystal.Entity);
Dragon.init = function(self)
  self:add_component("Health", 400);
end

This site uses Just the Docs, a documentation theme for Jekyll.