speed

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const SpeedMessageType string = "SpeedMessage"

SpeedMessageType is the unique type identifier for SpeedMessage.

Variables

This section is empty.

Functions

This section is empty.

Types

type SpeedComponent

type SpeedComponent struct {
	engo.Point
}

SpeedComponent stores speed for an entity.

func (*SpeedComponent) GetSpeedComponent

func (s *SpeedComponent) GetSpeedComponent() *SpeedComponent

GetSpeedComponent provides type safe access to SpeedComponent.

type SpeedFace

type SpeedFace interface {
	GetSpeedComponent() *SpeedComponent
}

SpeedFace enforces type safe access to the underlying SpeedComponent.

type SpeedMessage

type SpeedMessage struct {
	*ecs.BasicEntity
	engo.Point
}

SpeedMessage updates the speed of an object within the system.

func (SpeedMessage) Type

func (SpeedMessage) Type() string

Type returns a unique string representation for SpeedMessage.

type SpeedSystem

type SpeedSystem struct {
	Level *common.Level
	// contains filtered or unexported fields
}

SpeedSystem handles speed and position updates for entities.

func (*SpeedSystem) Add

func (ss *SpeedSystem) Add(
	basic *ecs.BasicEntity,
	space *common.SpaceComponent,
	speed *SpeedComponent,
)

Add an entity to the SpeedSystem.

func (*SpeedSystem) AddByInterface

func (ss *SpeedSystem) AddByInterface(i ecs.Identifier)

AddByInterface adds entities to the system via Speedable interface.

func (*SpeedSystem) New

func (ss *SpeedSystem) New(*ecs.World)

New initialises SpeedSystem when it's added to the world.

func (*SpeedSystem) Remove

func (ss *SpeedSystem) Remove(b ecs.BasicEntity)

Remove an entity from the SpeedSystem.

func (*SpeedSystem) Update

func (ss *SpeedSystem) Update(dt float32)

Update the SpeedSystem this frame.

type Speedable

type Speedable interface {
	ecs.BasicFace
	common.AnimationFace
	common.SpaceFace
	SpeedFace
}

Speedable defines requirements for adding entities to the SpeedSystem automatically.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL