entity

package
v0.0.0-...-2d96230 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MinEnemyMoveSpeed = 4
	MaxEnemyMoveSpeed = 8
)
View Source
const (
	PathingFollow byte = iota
	PathingAnticipateY
)
View Source
const (
	MaxDistanceShort byte = iota
	MaxDistanceMedium
	MaxDistanceLong
	MaxDistanceVeryLong
)
View Source
const (
	EntityChest = 0.
	EntityEnemy = 1.
	EntityAoe   = 2.
	EntityHeart = 3.
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Chest

type Chest struct {
	// contains filtered or unexported fields
}

func (*Chest) Contact

func (c *Chest) Contact() Contact

func (*Chest) Destroyed

func (b *Chest) Destroyed() bool

func (*Chest) GetGfxParams

func (c *Chest) GetGfxParams() (float32, float32, float32, float32)

func (*Chest) GetPosition

func (b *Chest) GetPosition() (float64, float64)

func (*Chest) GetSize

func (b *Chest) GetSize() (float64, float64)

func (*Chest) Update

func (c *Chest) Update(px, py float64)

type Contact

type Contact byte
const (
	ContactNone Contact = iota
	ContactDamageHalfHP
	ContactDamage1HP
	ContactDamage2HP
	ContactHeal1HP
	ContactItem
)

type Enemy

type Enemy struct {
	// contains filtered or unexported fields
}

func (*Enemy) Contact

func (e *Enemy) Contact() Contact

func (*Enemy) Destroyed

func (b *Enemy) Destroyed() bool

func (*Enemy) GetGfxParams

func (e *Enemy) GetGfxParams() (float32, float32, float32, float32)

func (*Enemy) GetPosition

func (b *Enemy) GetPosition() (float64, float64)

func (*Enemy) GetSize

func (b *Enemy) GetSize() (float64, float64)

func (*Enemy) Update

func (e *Enemy) Update(px, py float64)

type EnemySpec

type EnemySpec struct {
	Pathing       byte
	MaxDistance   byte
	MoveSpeed     float64
	ContactDamage Contact
}

type Entity

type Entity interface {
	Update(px, py float64)
	Contact() Contact
	Destroyed() bool
	GetPosition() (float64, float64)
	GetSize() (float64, float64)
	GetGfxParams() (float32, float32, float32, float32)
}

func NewChest

func NewChest(x, y float64) Entity

func NewEnemy

func NewEnemy(x, y, w, h float64, spec EnemySpec) Entity

func NewHeart

func NewHeart(x, y float64) Entity

type Heart

type Heart struct {
	// contains filtered or unexported fields
}

func (*Heart) Contact

func (h *Heart) Contact() Contact

func (*Heart) Destroyed

func (b *Heart) Destroyed() bool

func (*Heart) GetGfxParams

func (h *Heart) GetGfxParams() (float32, float32, float32, float32)

func (*Heart) GetPosition

func (b *Heart) GetPosition() (float64, float64)

func (*Heart) GetSize

func (b *Heart) GetSize() (float64, float64)

func (*Heart) Update

func (h *Heart) Update(px, py float64)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL