Documentation
¶
Index ¶
- Constants
- func DefaultDrop(elapsedMinutes float32, x, y float64) []item.Item
- type BaseMeleeEnemy
- func (e *BaseMeleeEnemy) Draw(screen *ebiten.Image, camX, camY float64)
- func (e *BaseMeleeEnemy) IsAlive() bool
- func (e *BaseMeleeEnemy) SetAttackAnimation(player *player.Player)
- func (e *BaseMeleeEnemy) SetWalkingAnimation(player *player.Player)
- func (e *BaseMeleeEnemy) TakeDamage(damage float64)
- func (e *BaseMeleeEnemy) TryDrop(elapsedMinutes float32) []item.Item
- func (e *BaseMeleeEnemy) Update(player *player.Player, dt float64)
- type BaseMeleeOptions
- type CabbageEnemy
- type CarrotEnemy
- type DamageIndicator
- type Enemy
- func (e *Enemy) AddKnockback(from *component.Vector2D, dist float64)
- func (e *Enemy) DefaultDraw(screen *ebiten.Image, camX, camY float64, width int, height int, ...)
- func (e *Enemy) GetPosition() component.Vector2D
- func (e *Enemy) GetType() EnemyType
- func (e *Enemy) IsAlive() bool
- func (e *Enemy) MoveTowards(target component.Vector2D, dt float64)
- func (e *Enemy) SetPosition(pos component.Vector2D)
- func (e *Enemy) TakeDamage(damage float64)
- func (e *Enemy) UpdateKnockback()
- type EnemyInterface
- type EnemyType
- type LeekEnemy
- type MeleeEnemyData
- type OnionEnemy
- type PotatoEnemy
- type RadishEnemy
- type RangedEnemyData
Constants ¶
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BaseMeleeEnemy ¶
func NewBaseMeleeEnemy ¶
func NewBaseMeleeEnemy(enemyType EnemyType, pos component.Vector2D, store *animation.AnimationStore, op *BaseMeleeOptions) *BaseMeleeEnemy
func (*BaseMeleeEnemy) Draw ¶
func (e *BaseMeleeEnemy) Draw(screen *ebiten.Image, camX, camY float64)
func (*BaseMeleeEnemy) IsAlive ¶
func (e *BaseMeleeEnemy) IsAlive() bool
Mark enemies as dead after the death animation is finished
func (*BaseMeleeEnemy) SetAttackAnimation ¶
func (e *BaseMeleeEnemy) SetAttackAnimation(player *player.Player)
func (*BaseMeleeEnemy) SetWalkingAnimation ¶
func (e *BaseMeleeEnemy) SetWalkingAnimation(player *player.Player)
func (*BaseMeleeEnemy) TakeDamage ¶
func (e *BaseMeleeEnemy) TakeDamage(damage float64)
type BaseMeleeOptions ¶
type CabbageEnemy ¶
type CabbageEnemy struct {
BaseMeleeEnemy
}
func NewCabbageEnemy ¶
func NewCabbageEnemy(pos component.Vector2D) *CabbageEnemy
type CarrotEnemy ¶
type CarrotEnemy struct {
BaseMeleeEnemy
}
func NewCarrotEnemy ¶
func NewCarrotEnemy(pos component.Vector2D) *CarrotEnemy
type DamageIndicator ¶
type DamageIndicator struct {
Damage float64
Pos component.Vector2D
Offset component.Vector2D
Dir component.Vector2D
Speed float64
AliveUntil time.Time
Font font.Face
}
func NewDamageIndicator ¶
type Enemy ¶
type Enemy struct {
entity.Entity
Health component.Health
Knockback component.Knockback
Speed float64
Damage float64
AttackCooldown float64
DropProb float32
DropAmount int
DropAmountPerMinute float32
// contains filtered or unexported fields
}
func (*Enemy) DefaultDraw ¶
func (*Enemy) GetPosition ¶
func (*Enemy) SetPosition ¶
func (*Enemy) TakeDamage ¶
func (*Enemy) UpdateKnockback ¶
func (e *Enemy) UpdateKnockback()
type EnemyInterface ¶
type EnemyInterface interface {
Update(player *player.Player, dt float64)
Draw(screen *ebiten.Image, camX, camY float64)
GetPosition() component.Vector2D
SetPosition(pos component.Vector2D)
IsAlive() bool
TakeDamage(damage float64)
AddKnockback(from *component.Vector2D, distance float64)
TryDrop(elapsedMinutes float32) []item.Item
GetType() EnemyType
}
type LeekEnemy ¶
type LeekEnemy struct {
BaseMeleeEnemy
}
type MeleeEnemyData ¶
type MeleeEnemyData struct {
AttackRange float64
}
type OnionEnemy ¶
type OnionEnemy struct {
BaseMeleeEnemy
}
func NewLeekEnemy ¶
func NewLeekEnemy(pos component.Vector2D) *OnionEnemy
func NewOnionEnemy ¶
func NewOnionEnemy(pos component.Vector2D) *OnionEnemy
type PotatoEnemy ¶
type PotatoEnemy struct {
BaseMeleeEnemy
}
func NewPotatoEnemy ¶
func NewPotatoEnemy(pos component.Vector2D) *PotatoEnemy
type RadishEnemy ¶
type RadishEnemy struct {
BaseMeleeEnemy
}
func NewRadishEnemy ¶
func NewRadishEnemy(pos component.Vector2D) *RadishEnemy
type RangedEnemyData ¶
type RangedEnemyData struct {
ProjectileSpeed float64
}
Click to show internal directories.
Click to hide internal directories.