Documentation
¶
Index ¶
Constants ¶
View Source
const ( AxisVertical string = "vertical" AxisHorizontal string = "horiztonal" )
Axes for control input.
View Source
const ( ButtonUp string = "up" ButtonDown string = "down" ButtonLeft string = "left" ButtonRight string = "right" ButtonSprint string = "sprint" )
Buttons for control input.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ControlComponent ¶
ControlComponent stores control input for player entity.
func (*ControlComponent) GetControlComponent ¶
func (c *ControlComponent) GetControlComponent() *ControlComponent
GetControlComponent provides type safe access to ControlComponent.
type ControlFace ¶
type ControlFace interface {
GetControlComponent() *ControlComponent
}
ControlFace enforces type safe access to the underlying ControlComponent.
type ControlSystem ¶
type ControlSystem struct {
// contains filtered or unexported fields
}
ControlSystem handles player input.
func (*ControlSystem) Add ¶
func (cs *ControlSystem) Add( b *ecs.BasicEntity, c *ControlComponent, )
Add an entity to the ControlSystem.
func (*ControlSystem) AddByInterface ¶
func (cs *ControlSystem) AddByInterface(i ecs.Identifier)
AddByInterface adds entities to the system via Controlable interface.
func (*ControlSystem) New ¶
func (cs *ControlSystem) New(*ecs.World)
New initialises ControlSystem when it's added to the world.
func (*ControlSystem) Remove ¶
func (cs *ControlSystem) Remove(b ecs.BasicEntity)
Remove an entity from the ControlSystem.
func (*ControlSystem) Update ¶
func (cs *ControlSystem) Update(dt float32)
Update the ControlSystem this frame.
type Controlable ¶
type Controlable interface { ecs.BasicFace ControlFace }
Controlable defines requirements for adding entities to the ControlSystem automatically.
Click to show internal directories.
Click to hide internal directories.