Documentation ¶
Index ¶
- func NewPlayers() error
- type Lanes
- type Player
- func (p *Player) BeBlocked(blocked bool)
- func (p *Player) Close() error
- func (p *Player) Draw(screen *ebiten.Image) error
- func (p *Player) Eat(stamina int)
- func (p *Player) GetOffset() image.Point
- func (p *Player) GetPosition() view.Vector
- func (p *Player) GetRectangle() image.Rectangle
- func (p *Player) GetStamina() int
- func (p *Player) GetVelocity() view.Vector
- func (p *Player) InitilizeWithLanesInfo(heights []float64) error
- func (p *Player) Pause()
- func (p *Player) ReStart()
- func (p *Player) Start()
- func (p *Player) Update() error
- type Stamina
- type State
- type StepAnimation
- type TimeAnimation
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Lanes ¶
type Lanes struct {
// contains filtered or unexported fields
}
Lanes manages the player's lane to run.
func (*Lanes) Descend ¶
Descend sets the target lane to descend. When this function is triggered successfully, true is returned.
func (*Lanes) IsReachedTarget ¶
IsReachedTarget returns wchich the player reached the target.
func (*Lanes) SetHeights ¶
SetHeights sets the heights of the lanes.
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) BeBlocked ¶ added in v0.0.4
BeBlocked puts the player in a position where the path is blocked by an obstacle.
func (*Player) GetPosition ¶ added in v0.0.4
GetPosition return the current position of this player.
func (*Player) GetRectangle ¶ added in v0.0.4
GetRectangle returns the edge rentangle of this player.
func (*Player) GetStamina ¶ added in v0.0.4
GetStamina returns the stamina value fo this character.
func (*Player) GetVelocity ¶ added in v0.0.4
GetVelocity returns the velocity of this playable character.
func (*Player) InitilizeWithLanesInfo ¶ added in v0.0.4
InitilizeWithLanesInfo 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.
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
NewStamina returns a new stamina engine.
func (*Stamina) Consumes ¶ added in v0.0.4
Consumes 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
GetStamina returns the current stamina value.
func (*Stamina) Initialize ¶ added in v0.0.4
func (s *Stamina) Initialize()
Initialize initializes stamina engine.
type StepAnimation ¶
type StepAnimation struct {
// contains filtered or unexported fields
}
StepAnimation is an animation. This animates according to the number of steps.
func NewStepAnimation ¶
func NewStepAnimation(frames []*ebiten.Image, duration int) *StepAnimation
NewStepAnimation returns a new StepAnimation generated with args.
func (*StepAnimation) AddStep ¶
func (s *StepAnimation) AddStep(steps int)
AddStep adds steps information. If your character moved, please call this function with steps information.
func (*StepAnimation) GetCurrentFrame ¶
func (s *StepAnimation) GetCurrentFrame() *ebiten.Image
GetCurrentFrame returns a current frame image. This function determines the current frame based on the information on how far a character moved. If the sum of steps is grater than the DurationSteps, this function will return the next frame.
type TimeAnimation ¶
type TimeAnimation struct {
// contains filtered or unexported fields
}
TimeAnimation is an animation. This animates according to elapsed time.
func NewTimeAnimation ¶
func NewTimeAnimation(frames []*ebiten.Image, duration float64) *TimeAnimation
NewTimeAnimation returns a new TimeAnimation generated with args.
func (*TimeAnimation) GetCurrentFrame ¶
func (t *TimeAnimation) GetCurrentFrame() *ebiten.Image
GetCurrentFrame returns a current frame image. This function determines the current frame according to elapsed time. If the elapsed time is grater than the DurationSecond, this function will return the next frame.