character

package
v0.0.0-...-d39b092 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PlayerHealth = 2
)

Variables

This section is empty.

Functions

func ResourceForCollectible

func ResourceForCollectible(mType CollectibleType) fyne.Resource

func ResourceForMover

func ResourceForMover(mType MoverType) fyne.Resource

func ResourceForWall

func ResourceForWall() fyne.Resource

Types

type Attacker

type Attacker interface {
	Attack(int) int
}

type AttackerType

type AttackerType int8
const (
	NoneAttackerType AttackerType = iota
	LowAttackerType
	MediumAttackerType
	HighAttackerType
)

type BaseCharacter

type BaseCharacter interface {
	CharacterImage() fyne.Resource
	Type() CharacterType
	SetType(CharacterType)
	InitCharacter(*board.Position)
	SetCharacterPosition(*board.Position)
	Position() *board.Position
}

func NewCharacter

func NewCharacter(mType CharacterType) BaseCharacter

type CharacterType

type CharacterType struct {
	MoverType       MoverType
	CollectibleType CollectibleType
}

type Coin

type Coin struct {
	BaseCharacter
	// contains filtered or unexported fields
}

func (*Coin) Collect

func (char *Coin) Collect()

func (*Coin) Value

func (char *Coin) Value() int

type Collectible

type Collectible interface {
	Collect()
	Value() int
}

type CollectibleType

type CollectibleType int8
const (
	NoneCollectibleType CollectibleType = iota
	CoinType
)

type GhostBlue

type GhostBlue struct {
	BaseCharacter
	// contains filtered or unexported fields
}

func (*GhostBlue) Attack

func (a *GhostBlue) Attack(pHealth int) int

func (*GhostBlue) Move

func (m *GhostBlue) Move() move.Direction

type GhostOrange

type GhostOrange struct {
	BaseCharacter
	// contains filtered or unexported fields
}

func (*GhostOrange) Attack

func (a *GhostOrange) Attack(pHealth int) int

func (*GhostOrange) Move

func (m *GhostOrange) Move() move.Direction

type GhostRed

type GhostRed struct {
	BaseCharacter
	// contains filtered or unexported fields
}

func (*GhostRed) Attack

func (a *GhostRed) Attack(pHealth int) int

func (*GhostRed) Move

func (m *GhostRed) Move() move.Direction

type GhostWhite

type GhostWhite struct {
	BaseCharacter
	// contains filtered or unexported fields
}

func (*GhostWhite) Attack

func (a *GhostWhite) Attack(pHealth int) int

func (*GhostWhite) Move

func (m *GhostWhite) Move() move.Direction

type Mover

type Mover interface {
	Move() move.Direction
}

type MoverType

type MoverType int8
const (
	NoneMoverType MoverType = iota
	PlayerType
	GhostBlueType
	GhostRedType
	GhostWhiteType
	GhostOrangeType
)

type Player

type Player struct {
	BaseCharacter
	// contains filtered or unexported fields
}

func (*Player) AddScore

func (char *Player) AddScore(c Collectible)

func (*Player) Health

func (char *Player) Health() int

func (*Player) MapKeyCodeToDirection

func (char *Player) MapKeyCodeToDirection(k fyne.KeyEvent)

func (*Player) Move

func (char *Player) Move() move.Direction

func (*Player) Score

func (char *Player) Score() int

func (*Player) SetDirection

func (char *Player) SetDirection(dir move.Direction)

func (*Player) SetHealth

func (char *Player) SetHealth(h int)

Jump to

Keyboard shortcuts

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