Documentation ¶
Index ¶
- func SetStateOfEntity(originator, predecessor *engine.Entity, of *engine.Entity, state bool) bool
- func SetStateOfTarget(w *engine.World, originator, predecessor *engine.Entity, ...)
- type Fadable
- type Movable
- type Moving
- type NonSolidTouchable
- type Physics
- func (p *Physics) HandleTouch(trace engine.TraceResult)
- func (p *Physics) Init(w *engine.World, e *engine.Entity, contents level.Contents, ...)
- func (p *Physics) ModifyHitBoxCentered(bySize m.Delta) m.Delta
- func (p *Physics) ReadContents() level.Contents
- func (p *Physics) ReadGroundEntity() *engine.Entity
- func (p *Physics) ReadOnGroundVec() m.Delta
- func (p *Physics) ReadSubPixel() m.Delta
- func (p *Physics) ReadVelocity() m.Delta
- func (p *Physics) Reset()
- func (p *Physics) SetVelocity(velocity m.Delta)
- func (p *Physics) SetVelocityForJump(velocity m.Delta)
- func (p *Physics) Update()
- type Settable
- type TargetSelection
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetStateOfEntity ¶
SetStateOfEntity sets the state of an entity, if available. Returns whether the setting was successful.
func SetStateOfTarget ¶
func SetStateOfTarget(w *engine.World, originator, predecessor *engine.Entity, targets TargetSelection, state bool)
SetStateOfTarget toggles the state of all entities of the given target name to the given state. Includes WarpZones too. Excludes the given entity (should be the caller).
Types ¶
type Fadable ¶
type Fadable struct { Settable World *engine.World Entity *engine.Entity Alpha float64 Contents level.Contents FadeFrames int FadeDespawn bool AnimDir int AnimFrame int }
Fadable a mixin to make an object fade in/out when toggled. Must be initialized _after_ alpha and contents are set by the entity.
type Movable ¶
type Movable struct { Settable Physics World *engine.World Entity *engine.Entity Acceleration float64 From, To m.Pos AnimDir int }
Movable a mixin to make an object move back/forth when toggled. Must be initialized _after_ alpha and contents are set by the entity. Is shown in the "off" state in the editor. It moves using physics using a set acceleration value.
type NonSolidTouchable ¶
NonSolidTouchable implements the Touch handler for nonsolid entities. Overrides Update(), so if additional handling is desired, calls must be chained.
func (*NonSolidTouchable) Update ¶
func (t *NonSolidTouchable) Update()
type Physics ¶
type Physics struct { World *engine.World Entity *engine.Entity Contents level.Contents OnGround bool OnGroundVec m.Delta // Vector that points "down" in gravity direction. GroundEntity *engine.Entity Velocity m.Delta // An input to be set changed by caller. SubPixel m.Delta IgnoreEnt *engine.Entity // contains filtered or unexported fields }
func (*Physics) HandleTouch ¶
func (p *Physics) HandleTouch(trace engine.TraceResult)
func (*Physics) ModifyHitBoxCentered ¶
func (*Physics) ReadContents ¶
func (*Physics) ReadGroundEntity ¶
func (*Physics) ReadOnGroundVec ¶
func (*Physics) ReadSubPixel ¶
func (*Physics) ReadVelocity ¶
func (*Physics) SetVelocity ¶
func (*Physics) SetVelocityForJump ¶
type Settable ¶
Settable implements the SetState handler for settable entities.
type TargetSelection ¶
type TargetSelection []string
func ParseTarget ¶
func ParseTarget(target string) TargetSelection