item

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: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ItemNone = iota
	ItemRupee
	ItemGreenRupee
	ItemRedRupee
	ItemHeart
)

Variables

This section is empty.

Functions

func Clear

func Clear()

func Draw

func Draw(screen *ebiten.Image) error

func HitUpdate

func HitUpdate()

func MoveToFront

func MoveToFront(item *Item)

func Update

func Update()

Types

type Item

type Item struct {
	Data *ItemData
	// contains filtered or unexported fields
}

func At

func At(x, y float64) *Item

func HID

func HID(hid string) *Item

func Items

func Items() []*Item

func Key

func Key(index int) *Item

func New

func New(itemType int, x, y float64) (*Item, error)

func Pickup

func Pickup(x, y float64) *Item

func (*Item) AnimationAttack

func (n *Item) AnimationAttack() error

func (*Item) AnimationGotHit

func (n *Item) AnimationGotHit() error

func (*Item) Draw

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

func (*Item) EntityID

func (n *Item) EntityID() uint

func (*Item) HID

func (n *Item) HID() string

func (*Item) IsDead

func (n *Item) IsDead() bool

func (*Item) IsHit

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

func (*Item) Position

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

func (*Item) SHeight

func (n *Item) SHeight() int

func (*Item) SWidth

func (n *Item) SWidth() int

func (*Item) SetAnimation

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

SetAnimation sets the animation of the item

func (*Item) SetPosition

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

func (*Item) X

func (n *Item) X() float64

func (*Item) Y

func (n *Item) Y() float64

type ItemData

type ItemData struct {
	SpriteName string // Sprite is the file name
	LayerName  string // Layer is the layer on aseprite to use
	Value      int    // value, e.g. green rupee is 1
}

Jump to

Keyboard shortcuts

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