Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ClearPrecache ¶ added in v1.2.141
func ClearPrecache()
Types ¶
type Animation ¶
type Animation struct { SpriteBase Entity *engine.Entity Anim animation.State }
Animation is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque.
type CoverSprite ¶
type CoverSprite struct {
Sprite
}
CoverSprite is a Sprite with a high Z index. Use seldomly!
func (*CoverSprite) Spawn ¶
func (s *CoverSprite) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
type ExitButton ¶
type ExitButton struct {
SwitchableSprite
}
ExitButton shows as Esc key or Start button depending on input device.
func (*ExitButton) Spawn ¶
func (s *ExitButton) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
type MovableSprite ¶
MovableSprite is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque. Can be toggled from outside and will move back/forth.
func (*MovableSprite) Spawn ¶
func (s *MovableSprite) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*MovableSprite) Update ¶
func (s *MovableSprite) Update()
type MovingAnimation ¶
type MovingAnimation struct { Animation mixins.Moving mixins.Fadable mixins.NonSolidTouchable World *engine.World Entity *engine.Entity Alpha float64 FadeOnTouch bool RespawnOnTouch bool StopOnTouch bool FramesToMove int FramesToFade int }
MovingAnimation is a simple entity type that moves in a specified direction. Optionally despawns when hitting solid.
func (*MovingAnimation) Spawn ¶
func (s *MovingAnimation) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*MovingAnimation) Touch ¶
func (s *MovingAnimation) Touch(other *engine.Entity)
func (*MovingAnimation) Update ¶
func (s *MovingAnimation) Update()
type SpawnCounter ¶
type SpawnCounter struct{}
SpawnCounter triggers a target if it's been spawned a certain amount of times.
func (*SpawnCounter) Despawn ¶
func (s *SpawnCounter) Despawn()
func (*SpawnCounter) Spawn ¶
func (s *SpawnCounter) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*SpawnCounter) Touch ¶
func (s *SpawnCounter) Touch(other *engine.Entity)
func (*SpawnCounter) Update ¶
func (s *SpawnCounter) Update()
type Sprite ¶
type Sprite struct {
SpriteBase
}
Sprite is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque.
type SpriteBase ¶
type SpriteBase struct {
ZDefault int
}
SpriteBase is a base class for sprites. To instantiate it, just set the entity image, then forward to this.
func (*SpriteBase) Despawn ¶
func (s *SpriteBase) Despawn()
func (*SpriteBase) Spawn ¶
func (s *SpriteBase) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*SpriteBase) Touch ¶
func (s *SpriteBase) Touch(other *engine.Entity)
func (*SpriteBase) Update ¶
func (s *SpriteBase) Update()
type SwitchableAnimation ¶
SwitchableAnimation is a simple entity type that renders an animation. Can be toggled from outside.
func (*SwitchableAnimation) Spawn ¶
func (s *SwitchableAnimation) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*SwitchableAnimation) Update ¶
func (s *SwitchableAnimation) Update()
type SwitchableSprite ¶
SwitchableSprite is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque. Can be toggled from outside.
func (*SwitchableSprite) Spawn ¶
func (s *SwitchableSprite) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*SwitchableSprite) Update ¶
func (s *SwitchableSprite) Update()
type SwitchableText ¶
SwitchableText is a simple entity type that renders text. Can be toggled from outside.
func (*SwitchableText) SetState ¶
func (s *SwitchableText) SetState(originator, predecessor *engine.Entity, state bool)
func (*SwitchableText) Spawn ¶
func (s *SwitchableText) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*SwitchableText) Update ¶
func (s *SwitchableText) Update()