Components
class PlayerComponent < Scar::Component
property :health, :attack
def initialize(@health: Int32, @attack: Int32)
end
end
...
# e. g. in app#init
player = Entity.new("player",
PlayerComponent.new(1337, 42),
position: Vec.new(128, 128)
)
scene["level"] << playerLast updated