Documentation ¶
Index ¶
- Variables
- type Controller
- func (c *Controller) ActivateSound(err error) error
- func (c *Controller) Draw(screen *ebiten.Image)
- func (c *Controller) DrawWorld(screen *ebiten.Image)
- func (c *Controller) InitGame(f resetFlag) error
- func (c *Controller) MoveSound(err error) error
- func (c *Controller) QuitGame() error
- func (c *Controller) SaveConfigAndSwitchToScreen(screen MenuScreen) error
- func (c *Controller) SwitchSaveState(state int) error
- func (c *Controller) SwitchToCheckpoint(cp string) error
- func (c *Controller) SwitchToGame() error
- func (c *Controller) SwitchToScreen(screen MenuScreen) error
- func (c *Controller) Update() error
- func (c *Controller) UpdateWorld() error
- type CreditsScreen
- type MainScreen
- type MainScreenItem
- type MapScreen
- type MenuScreen
- type ResetScreen
- type ResetScreenItem
- type SaveStateScreen
- type SaveStateScreenItem
- type SettingsScreen
- type SettingsScreenItem
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) Init ¶
func (s *MapScreen) Init(m *Controller) error
type MenuScreen ¶
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 SaveStateScreen ¶
type SaveStateScreen struct { Controller *Controller Item SaveStateScreenItem Text [4]string }
func (*SaveStateScreen) Draw ¶
func (s *SaveStateScreen) Draw(screen *ebiten.Image)
func (*SaveStateScreen) Init ¶
func (s *SaveStateScreen) Init(m *Controller) error
func (*SaveStateScreen) Update ¶
func (s *SaveStateScreen) Update() error
type SaveStateScreenItem ¶
type SaveStateScreenItem int
const ( SaveStateA SaveStateScreenItem = iota SaveStateB SaveStateC SaveStateD SaveExit SaveStateCount )
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 SaveState Reset Back SettingsCount )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.