state

package
v0.0.1-jam Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	START = iota
	HOWTO
	QUIT
)
View Source
const (
	STATE_MENU = iota
	STATE_GAME
	STATE_HOWTO
	STATE_WIN
)

Variables

View Source
var MenuOptions = []string{
	"Start",
	"HowTo",
	"Quit",
}

Functions

func CopyLayout

func CopyLayout(lin [][]int) [][]int

Types

type Gameplay

type Gameplay struct {
	LvlFS *embed.FS
	// contains filtered or unexported fields
}

func (*Gameplay) Change

func (g *Gameplay) Change() int

func (*Gameplay) Draw

func (g *Gameplay) Draw(screen *ebiten.Image)

func (*Gameplay) FindInLayout

func (g *Gameplay) FindInLayout(value int) [][]int

func (*Gameplay) FindPassage

func (g *Gameplay) FindPassage()

func (*Gameplay) Init

func (g *Gameplay) Init()

func (*Gameplay) PosInLayoutBounds

func (g *Gameplay) PosInLayoutBounds(pos *vector.Vector2D) bool

func (*Gameplay) RestartCurrentLevel

func (g *Gameplay) RestartCurrentLevel()

func (*Gameplay) ReverseCurrentChar

func (g *Gameplay) ReverseCurrentChar()

func (*Gameplay) TraversePathFrom

func (g *Gameplay) TraversePathFrom(pos *vector.Vector2D) bool

func (*Gameplay) Update

func (g *Gameplay) Update()

type Howto

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

func (*Howto) Change

func (h *Howto) Change() int

func (*Howto) Draw

func (h *Howto) Draw(screen *ebiten.Image)

func (*Howto) Init

func (h *Howto) Init()

func (*Howto) Update

func (h *Howto) Update()
type Menu struct {
	// contains filtered or unexported fields
}
func (m *Menu) Change() int
func (m *Menu) Draw(screen *ebiten.Image)

TODO change colors to consts

func (m *Menu) Init()
func (m *Menu) Update()

type State

type State interface {
	Draw(screen *ebiten.Image)
	Update()
	Init() //TODO: pass slice of ints as options?
	Change() int
}

type Win

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

func (*Win) Change

func (w *Win) Change() int

func (*Win) Draw

func (w *Win) Draw(screen *ebiten.Image)

func (*Win) Init

func (w *Win) Init()

func (*Win) Update

func (w *Win) Update()

Jump to

Keyboard shortcuts

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