abstract class Scar::System
- Scar::System
- Reference
- Object
Overview
Base class for Systems
Systems define behaviours in the application e. g. player movement, ai updates, ..
Example usage:
class MySystem < Scar::System
def init(app, space)
puts "MySystem initialized!"
end
def update(app, space, dt)
# Move the player entity
space["player"].move(Vec.new(10, 0) * dt)
end
def render(app, space, dt)
puts "Executing custom rendering logic..."
end
end
Direct Known Subclasses
Defined in:
scar/system.crInstance Method Summary
-
#init(app : App, space : Space)
Override this for one-time initialization
-
#initialized : Bool
This property keeps track of wether
#init
has been called -
#initialized=(initialized : Bool)
This property keeps track of wether
#init
has been called -
#render(app : App, space : Space, dt)
Override this for custom rendering logic
-
#update(app : App, space : Space, dt)
Override this for any behaviour you want in you application
Instance Method Detail
Override this for one-time initialization
This method is called by the space containing this System on the first frame after it was added.
Override this for custom rendering logic
This method is called by the space containing this System on every frame before any rendering occurs.
Override this for any behaviour you want in you application
This method is called by the space containing this System on every frame before any rendering occurs.