states

package
v0.0.0-...-4ee5d08 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

type State interface {
	OnUpdate() error
	OnDraw(screen *ebiten.Image)
	OnEnter()
	OnLeave()
}

State is a interface for 5 essential functions for state transition

func MakeState

func MakeState(newState fsm.State, m *fsm.Machine, world *goecs.World, logicChannel chan db.GameMessage, uiChannel chan db.GameMessage) State

MakeState make

type StateLoading

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

StateLoading implements State interface and for loading scene

func NewStateLoading

func NewStateLoading(m *fsm.Machine, world *goecs.World, lch chan db.GameMessage, uch chan db.GameMessage) *StateLoading

NewStateLoading is a constructor

func (*StateLoading) OnDraw

func (s *StateLoading) OnDraw(screen *ebiten.Image)

OnDraw for draw scene

func (*StateLoading) OnEnter

func (s *StateLoading) OnEnter()

OnEnter for pre-process before entering state

func (*StateLoading) OnLeave

func (s *StateLoading) OnLeave()

OnLeave for post-process after leaving state

func (*StateLoading) OnUpdate

func (s *StateLoading) OnUpdate() error

OnUpdate for updating UI

type StateTitle

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

StateTitle implements State interface and for title menu

func NewStateTitle

func NewStateTitle(m *fsm.Machine, world *goecs.World, lch chan db.GameMessage, uch chan db.GameMessage) *StateTitle

NewStateTitle is a constructor

func (*StateTitle) OnDraw

func (s *StateTitle) OnDraw(screen *ebiten.Image)

OnDraw for draw scene

func (*StateTitle) OnEnter

func (s *StateTitle) OnEnter()

OnEnter for pre-process before entering state

func (*StateTitle) OnLeave

func (s *StateTitle) OnLeave()

OnLeave for post-process after leaving state

func (*StateTitle) OnUpdate

func (s *StateTitle) OnUpdate() error

OnUpdate for updating UI

Jump to

Keyboard shortcuts

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