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 (
RespawnHitboxBorder = 5 // Actually only the 6x6 center square of the 16x16 sprite.
)
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) 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) 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) 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 map[string]string Kaizo bool 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) 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) 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 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) 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) Touch ¶
func (j *SwitchableJumpPad) Touch(other *engine.Entity)
type TnihSign ¶
type TnihSign struct { mixins.NonSolidTouchable World *engine.World Entity *engine.Entity PersistentState map[string]string 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.