Documentation
¶
Index ¶
Constants ¶
const ( AppearFrames = 16 AppearXDistance = 2 * level.TileSize AppearYDistance = level.TileSize / 4 AppearSolidThreshold = 12 )
const ( DisappearFrames = 24 DisappearSolidThreshold = 1 )
const ( UseFramesPerPixel = 2 UsePixels = 4 )
const ( RespawnHitboxRemoveAtSides = 4 // Leaves 8px between two spikes, player doesn't fit there. RespawnHitboxRemoveAtTop = 4 // Only keep the bottom 12px. )
Let's do a somewhat forgiving hitbox.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppearBlock ¶
AppearBlock is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque.
func (*AppearBlock) Despawn ¶
func (a *AppearBlock) Despawn()
func (*AppearBlock) Spawn ¶
func (a *AppearBlock) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*AppearBlock) Touch ¶
func (a *AppearBlock) Touch(other *engine.Entity)
func (*AppearBlock) Update ¶
func (a *AppearBlock) Update()
type DisappearBlock ¶
type DisappearBlock struct {
mixins.Settable
World *engine.World
Entity *engine.Entity
Disappearing bool
AnimFrame int
}
DisappearBlock is an entity that disappears when touched and never reappears.
func (*DisappearBlock) Despawn ¶
func (a *DisappearBlock) Despawn()
func (*DisappearBlock) Spawn ¶
func (a *DisappearBlock) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*DisappearBlock) Touch ¶
func (a *DisappearBlock) Touch(other *engine.Entity)
func (*DisappearBlock) Update ¶
func (a *DisappearBlock) Update()
type ForceField ¶
type ForceField struct {
mixins.NonSolidTouchable
World *engine.World
Entity *engine.Entity
AlphaMod float64
AnimFrame int
Active bool
TouchedFrame int
ShockSound *sound.Sound
SourceImg *ebiten.Image
}
ForceField, when hit by the player, sends the player away from it.
func (*ForceField) Despawn ¶
func (f *ForceField) Despawn()
func (*ForceField) Spawn ¶
func (f *ForceField) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*ForceField) Touch ¶
func (f *ForceField) Touch(other *engine.Entity)
func (*ForceField) Update ¶
func (f *ForceField) Update()
type Give ¶
type Give struct {
mixins.NonSolidTouchable
Ability string
Text string
AnimFrame int
Anim animation.State
}
Give grants the player an ability when touched.
type JumpPad ¶
type JumpPad struct {
mixins.NonSolidTouchable
World *engine.World
Entity *engine.Entity
Destination m.Pos
Height int
TouchedFrame int
JumpSound *sound.Sound
}
JumpPad, when hit by the player, sends the player on path to set destination. Note that sadly, JumpPads are rarely ever useful in rooms that can be used in multiple orientations. May want to introduce required orientation like with checkpoints. Or could require player to hit jumppad from above.
type OneWay ¶
type OneWay struct {
World *engine.World
Entity *engine.Entity
AllowedDirection m.Delta
Anim animation.State
}
OneWay is an entity that can only be passed in one direction. It is implemented simply as being solid whenever it is on the left (or rotated direction) of the player.
type QuestionBlock ¶
type QuestionBlock struct {
World *engine.World
Entity *engine.Entity
PersistentState propmap.Map
Kaizo bool
Target mixins.TargetSelection
Used bool
UsedImage *ebiten.Image
UseAnimFrame int
Sound *sound.Sound
}
QuestionBlock is a simple entity type that renders a static sprite. It can be optionally solid and/or opaque.
func (*QuestionBlock) Despawn ¶
func (q *QuestionBlock) Despawn()
func (*QuestionBlock) Spawn ¶
func (q *QuestionBlock) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*QuestionBlock) Touch ¶
func (q *QuestionBlock) Touch(other *engine.Entity)
func (*QuestionBlock) Update ¶
func (q *QuestionBlock) Update()
type RespawnPlayer ¶
RespawnPlayer respawns the player when touched.
func (*RespawnPlayer) Despawn ¶
func (r *RespawnPlayer) Despawn()
func (*RespawnPlayer) Spawn ¶
func (r *RespawnPlayer) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*RespawnPlayer) Touch ¶
func (r *RespawnPlayer) Touch(other *engine.Entity)
func (*RespawnPlayer) Update ¶
func (r *RespawnPlayer) Update()
type SetState ¶
type SetState struct {
World *engine.World
Entity *engine.Entity
mixins.NonSolidTouchable
target.SetStateTarget
SendUntouch bool
SendOnce bool
PlayerOnly bool
Touching bool
Touched bool
State bool
Originator *engine.Entity
}
SetState overrides the boolean state of a warpzone or entity.
type Switch ¶
type Switch struct {
SetState
Entity *engine.Entity
Anim animation.State
AnimState bool
SwitchOn, SwitchOff *sound.Sound
}
Switch overrides the boolean state of a warpzone or entity.
type SwitchMusic ¶
type SwitchMusic struct {
mixins.NonSolidTouchable
target.SwitchMusicTarget
}
SwitchMusic just changes the music track to the given one.
func (*SwitchMusic) Despawn ¶
func (s *SwitchMusic) Despawn()
func (*SwitchMusic) Spawn ¶
func (s *SwitchMusic) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*SwitchMusic) Touch ¶
func (s *SwitchMusic) Touch(other *engine.Entity)
func (*SwitchMusic) Update ¶
func (s *SwitchMusic) Update()
type SwitchableJumpPad ¶
JumpPad, when hit by the player, sends the player on path to set destination. Note that sadly, JumpPads are rarely ever useful in rooms that can be used in multiple orientations. May want to introduce required orientation like with checkpoints. Or could require player to hit jumppad from above.
func (*SwitchableJumpPad) Spawn ¶
func (j *SwitchableJumpPad) Spawn(w *engine.World, sp *level.SpawnableProps, e *engine.Entity) error
func (*SwitchableJumpPad) Touch ¶
func (j *SwitchableJumpPad) Touch(other *engine.Entity)
type TnihSign ¶
type TnihSign struct {
mixins.NonSolidTouchable
World *engine.World
Entity *engine.Entity
PersistentState propmap.Map
Text string
SeenImage *ebiten.Image
Sound *sound.Sound
Target mixins.TargetSelection
Touching bool
Touched bool
Centerprint *centerprint.Centerprint
}
TnihSign just displays a text and remembers that it was hit.