character

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitializeCharacter added in v0.0.5

func InitializeCharacter()

func NewPlayers

func NewPlayers() error

NewPlayers load all player characters.

Types

type Player

type Player struct {
	// Specified at creation and not changed
	StandingImage *ebiten.Image
	Description   string
	// contains filtered or unexported fields
}

Player is a player character.

var (
	Kurona     *Player
	Koma       *Player
	Shishimaru *Player

	// Selected is the selected player.
	Selected *Player
)

player characters

func (*Player) AddTension added in v0.0.5

func (p *Player) AddTension(num int)

func (*Player) BeBlocked added in v0.0.4

func (p *Player) BeBlocked(isBlocked bool)

BeBlocked puts the player in a position where the path is blocked by an obstacle.

func (*Player) Close

func (p *Player) Close() error

Close closes the inner resources.

func (*Player) ConsumeStaminaByAttack added in v0.0.5

func (p *Player) ConsumeStaminaByAttack(num int)

func (*Player) Draw

func (p *Player) Draw(screen *ebiten.Image)

Draw draws the character image.

func (*Player) DrawSpecialEffect added in v0.0.5

func (p *Player) DrawSpecialEffect(screen *ebiten.Image)

func (*Player) Eat added in v0.0.4

func (p *Player) Eat(foodVol int)

Eat eats foods and restore stamina value by argument value.

func (*Player) FinishSpEffect added in v0.0.5

func (p *Player) FinishSpEffect() bool

func (*Player) GetHeight added in v0.0.5

func (p *Player) GetHeight() float64

func (*Player) GetPosition added in v0.0.4

func (p *Player) GetPosition() *view.Vector

GetPosition return the current position of this player.

func (*Player) GetRectangle added in v0.0.4

func (p *Player) GetRectangle() *view.HitRectangle

GetRectangle returns the edge rectangle of this player.

func (*Player) GetScrollVelocity added in v0.0.5

func (p *Player) GetScrollVelocity() *view.Vector

GetScrollVelocity returns the velocity to scroll field parts.

func (*Player) GetStamina added in v0.0.4

func (p *Player) GetStamina() int

GetStamina returns the stamina value fo this character.

func (*Player) GetTension added in v0.0.5

func (p *Player) GetTension() int

func (*Player) InitializeWithLanes added in v0.0.5

func (p *Player) InitializeWithLanes(lanes *field.Lanes) error

InitializeWithLanesInfo sets the lanes information. The player can run on the lane or move between lanes based on the lane drawing height information received in the argument.

func (*Player) IsAttacked added in v0.0.5

func (p *Player) IsAttacked() (bool, *view.HitRectangle, float64)

func (*Player) Pause

func (p *Player) Pause()

Pause pauses this character.

func (*Player) ReStart

func (p *Player) ReStart()

ReStart starts again this character.

func (*Player) SetInputChecker added in v0.0.5

func (p *Player) SetInputChecker(laneRectArray []image.Rectangle, upBtn, downBtn, atkBtn, spBtn vpad.TriggerButton)

func (*Player) Start

func (p *Player) Start()

Start starts playing.

func (*Player) StartSpEffect added in v0.0.5

func (p *Player) StartSpEffect() bool

func (*Player) Update

func (p *Player) Update()

Update updates the character regarding the user input.

func (*Player) UpdateSpecialEffect added in v0.0.5

func (p *Player) UpdateSpecialEffect()

type Stamina added in v0.0.4

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

Stamina manages the consumption and recovery of stamina.

func NewStamina added in v0.0.4

func NewStamina(max, endurance int) *Stamina

NewStamina returns a new stamina engine.

func (*Stamina) Add added in v0.0.5

func (s *Stamina) Add(val int)

Add restores the stamina to the value specified in the argument. However, it will not restore more than the maximum value.

func (*Stamina) ConsumeByAttack added in v0.0.5

func (s *Stamina) ConsumeByAttack(brokenNum int)

func (*Stamina) ConsumesByState added in v0.0.5

func (s *Stamina) ConsumesByState(state move.State)

ConsumesByState encourages a decrease in stamina by the value specified in the argument. The actual stamina is reduced when the consumption is greater than the "endurance". The stamina value does not go below zero.

func (*Stamina) GetStamina added in v0.0.4

func (s *Stamina) GetStamina() int

GetStamina returns the current stamina value.

func (*Stamina) Initialize added in v0.0.4

func (s *Stamina) Initialize()

Initialize initializes stamina engine.

type Tension added in v0.0.5

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

Tension is the character's tension. If this reaches the max value, the character can shot a special skill.

func NewTension added in v0.0.5

func NewTension(max, border int) *Tension

func (*Tension) AddByAttack added in v0.0.5

func (t *Tension) AddByAttack(brokenNum int)

func (*Tension) AddByState added in v0.0.5

func (t *Tension) AddByState(state move.State)

AddByState adds val to tension's val.

func (*Tension) Get added in v0.0.5

func (t *Tension) Get() int

func (*Tension) Initialize added in v0.0.5

func (t *Tension) Initialize()

func (*Tension) IsMax added in v0.0.5

func (t *Tension) IsMax() bool

Jump to

Keyboard shortcuts

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