menu

package
v1.0.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RegularTermination = errors.New("exited normally")

Functions

This section is empty.

Types

type Controller

type Controller struct {
	World  engine.World
	Screen MenuScreen
	// contains filtered or unexported fields
}

func (*Controller) ActivateSound

func (c *Controller) ActivateSound(err error) error

ActivateSound plays the sound effect to activate something.

func (*Controller) Draw

func (c *Controller) Draw(screen *ebiten.Image)

func (*Controller) DrawWorld

func (c *Controller) DrawWorld(screen *ebiten.Image)

func (*Controller) InitGame

func (c *Controller) InitGame(f resetFlag) error

InitGame is called by menu screens to load/reset the game.

func (*Controller) MoveSound

func (c *Controller) MoveSound(err error) error

MoveSound plays the sound effect to activate something.

func (*Controller) QuitGame

func (c *Controller) QuitGame() error

QuitGame is called by menu screens to end the game.

func (*Controller) SaveConfigAndSwitchToScreen

func (c *Controller) SaveConfigAndSwitchToScreen(screen MenuScreen) error

SaveConfigAndSwitchToScreen is called by menu screens to go to a different menu screen.

func (*Controller) SwitchSaveState

func (c *Controller) SwitchSaveState(state int) error

SwitchSaveState switches to a given save state.

func (*Controller) SwitchToCheckpoint

func (c *Controller) SwitchToCheckpoint(cp string) error

SwitchToCheckpoint switches to a specific checkpoint.

func (*Controller) SwitchToGame

func (c *Controller) SwitchToGame() error

SwitchToGame switches to the game without teleporting.

func (*Controller) SwitchToScreen

func (c *Controller) SwitchToScreen(screen MenuScreen) error

SwitchToScreen is called by menu screens to go to a different menu screen.

func (*Controller) Update

func (c *Controller) Update() error

func (*Controller) UpdateWorld

func (c *Controller) UpdateWorld() error

type CreditsScreen

type CreditsScreen struct {
	// Must be set when creating.
	Fancy bool // With music, and constant speed - no scrolling. No exiting. Background image not needed - we use last game screen.

	Controller *Controller
	Lines      []string // Actual lines to display.
	Frame      int      // Current scroll position.
	MaxFrame   int      // Maximum scroll position.
	Exits      int      // How often exit was pressed. Need to press 7 times to leave fancy credits.
}

func (*CreditsScreen) Draw

func (s *CreditsScreen) Draw(screen *ebiten.Image)

func (*CreditsScreen) Init

func (s *CreditsScreen) Init(m *Controller) error

func (*CreditsScreen) Update

func (s *CreditsScreen) Update() error

type MainScreen

type MainScreen struct {
	Controller *Controller
	Item       MainScreenItem
}

func (*MainScreen) Draw

func (s *MainScreen) Draw(screen *ebiten.Image)

func (*MainScreen) Init

func (s *MainScreen) Init(m *Controller) error

func (*MainScreen) Update

func (s *MainScreen) Update() error

type MainScreenItem

type MainScreenItem int
const (
	Play MainScreenItem = iota
	Settings
	Credits
	Quit
	MainCount
)

type MapScreen

type MapScreen struct {
	Controller  *Controller
	Level       *level.Level
	CurrentCP   string
	SortedLocs  []string
	SortedEdges map[string][]level.CheckpointEdge
	// contains filtered or unexported fields
}

func (*MapScreen) Draw

func (s *MapScreen) Draw(screen *ebiten.Image)

func (*MapScreen) Init

func (s *MapScreen) Init(m *Controller) error

func (*MapScreen) Update

func (s *MapScreen) Update() error
type MenuScreen interface {
	Init(m *Controller) error
	Update() error
	Draw(screen *ebiten.Image)
}

type ResetScreen

type ResetScreen struct {
	Controller *Controller
	Item       ResetScreenItem
	ResetFrame int
}

func (*ResetScreen) Draw

func (s *ResetScreen) Draw(screen *ebiten.Image)

func (*ResetScreen) Init

func (s *ResetScreen) Init(m *Controller) error

func (*ResetScreen) Update

func (s *ResetScreen) Update() error

type ResetScreenItem

type ResetScreenItem int
const (
	ResetNothing ResetScreenItem = iota
	ResetConfig
	ResetGame
	BackToMain
	ResetCount
)

type SettingsScreen

type SettingsScreen struct {
	Controller *Controller
	Item       SettingsScreenItem
}

func (*SettingsScreen) Draw

func (s *SettingsScreen) Draw(screen *ebiten.Image)

func (*SettingsScreen) Init

func (s *SettingsScreen) Init(m *Controller) error

func (*SettingsScreen) Update

func (s *SettingsScreen) Update() error

type SettingsScreenItem

type SettingsScreenItem int
const (
	Fullscreen SettingsScreenItem = iota
	Graphics
	Volume
	Reset
	Back
	SettingsCount
)

Jump to

Keyboard shortcuts

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