npc

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NpcNone = iota
	NpcBat
	NpcCloud
	NpcFlower
	NpcAseprite
	NpcPot
	NpcKnight
	NpcStump
)

Variables

This section is empty.

Functions

func Clear

func Clear()

func Draw

func Draw(screen *ebiten.Image) error

func HitUpdate

func HitUpdate()

func Knockback

func Knockback(distance float64)

func MoveToFront

func MoveToFront(npc *Npc)

func Update

func Update()

Types

type Npc

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

func At

func At(x, y float64) *Npc

func HID

func HID(hid string) *Npc

func Key

func Key(index int) *Npc

func New

func New(npcType int, x float64, y float64, player entity.Entiter) (*Npc, error)

func Npcs

func Npcs() []*Npc

func (*Npc) AnimationAttack

func (n *Npc) AnimationAttack() error

func (*Npc) AnimationGotHit

func (n *Npc) AnimationGotHit() error

func (*Npc) Damage

func (n *Npc) Damage(damage int) bool

func (*Npc) Draw

func (n *Npc) Draw(screen *ebiten.Image) error

func (*Npc) EntityID

func (n *Npc) EntityID() uint

func (*Npc) HID

func (n *Npc) HID() string

func (*Npc) IsDead

func (n *Npc) IsDead() bool

func (*Npc) IsHit

func (n *Npc) IsHit(x, y float64) bool

func (*Npc) IsSimpleHit

func (n *Npc) IsSimpleHit(x, y float64) bool

func (*Npc) Position

func (n *Npc) Position() (float64, float64)

func (*Npc) SHeight

func (n *Npc) SHeight() int

func (*Npc) SWidth

func (n *Npc) SWidth() int

func (*Npc) SetAnimation

func (n *Npc) SetAnimation(name string) error

SetAnimation sets the animation of the npc

func (*Npc) SetPosition

func (n *Npc) SetPosition(x, y float64)

func (*Npc) Update

func (n *Npc) Update()

func (*Npc) X

func (n *Npc) X() float64

func (*Npc) Y

func (n *Npc) Y() float64

type NpcData

type NpcData struct {
	MaxHP     int
	Sprite    *SpriteData
	MoveSpeed float64
}

type SpriteData

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

Jump to

Keyboard shortcuts

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