Documentation ¶
Index ¶
- Constants
- func ItemBaselineY(i, n int) int
- 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) GameChanged() error
- func (c *Controller) InitGame(f resetFlag) error
- func (c *Controller) LevelChanged() error
- func (c *Controller) MoveSound(err error) error
- func (c *Controller) NextFrame(f func() error) error
- func (c *Controller) QueryMouseItem(item interface{}, count int) Direction
- 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 Direction
- type LicensesScreen
- type MainScreen
- type MainScreenItem
- type MapScreen
- type MenuScreen
- type ResetScreen
- type ResetScreenItem
- type SaveStateScreen
- type SaveStateScreenItem
- type SettingsScreen
- type SettingsScreenItem
- type TouchEditScreen
- type TouchEditScreenItem
Constants ¶
const ( Play = iota Settings Credits Quit MainCount )
const ( ResetNothing = iota ResetConfig ResetGame BackToMain ResetCount )
const ( SaveStateA = iota SaveState4 SaveStateX SaveStateY SaveExit SaveStateCount )
const ( Dynamic1 = iota Dynamic2 Graphics Quality Volume Language SaveState Reset Back SettingsCount )
const ( TouchDone = iota TouchReset TouchCount )
const CenterX = engine.GameWidth / 2
const HeaderY = engine.GameHeight / 4
Variables ¶
This section is empty.
Functions ¶
func ItemBaselineY ¶ added in v1.1.112
Types ¶
type Controller ¶
type Controller struct { World engine.World Screen MenuScreen WhiteImage *ebiten.Image // 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) GameChanged ¶ added in v1.3.103
func (c *Controller) GameChanged() error
func (*Controller) InitGame ¶
func (c *Controller) InitGame(f resetFlag) error
InitGame is called by menu screens to load/reset the game.
func (*Controller) LevelChanged ¶ added in v1.3.103
func (c *Controller) LevelChanged() error
func (*Controller) MoveSound ¶
func (c *Controller) MoveSound(err error) error
MoveSound plays the sound effect to activate something.
func (*Controller) NextFrame ¶ added in v1.4.119
func (c *Controller) NextFrame(f func() error) error
NextFrame calls the given function next render frame instead of regular processing. All input events are suppressed until then.
This is useful to delay expensive actions.
func (*Controller) QueryMouseItem ¶ added in v1.1.112
func (c *Controller) QueryMouseItem(item interface{}, count int) Direction
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 // Subpixel accumulator. ScrollPos int // Current 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 LicensesScreen ¶ added in v1.2.217
type LicensesScreen struct { Controller *Controller Frame int // Subpixel accumulator. ScrollPos int // Current scroll position. }
func (*LicensesScreen) Draw ¶ added in v1.2.217
func (s *LicensesScreen) Draw(screen *ebiten.Image)
func (*LicensesScreen) Init ¶ added in v1.2.217
func (s *LicensesScreen) Init(m *Controller) error
func (*LicensesScreen) Update ¶ added in v1.2.217
func (s *LicensesScreen) Update() error
type MainScreen ¶
type MainScreen struct { Controller *Controller Item MainScreenItem Count int }
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
type MapScreen ¶
type MapScreen struct { Controller *Controller Level *level.Level FirstCP string CurrentCP string SortedLocs []string SortedEdges map[string][]level.CheckpointEdge CPPos map[string]m.Pos MapRect m.Rect WalkFrame int // contains filtered or unexported fields }
func (*MapScreen) Init ¶
func (s *MapScreen) Init(c *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 WaitForKeyReleaseThenReset bool }
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
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
type SettingsScreen ¶
type SettingsScreen struct { Controller *Controller Item SettingsScreenItem CurrentGraphics graphicsSetting CurrentLanguage languageSetting TopItem SettingsScreenItem EditControls SettingsScreenItem Fullscreen SettingsScreenItem Stretch 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
type TouchEditScreen ¶ added in v1.3.43
type TouchEditScreen struct { Controller *Controller Item TouchEditScreenItem }
func (*TouchEditScreen) Draw ¶ added in v1.3.43
func (s *TouchEditScreen) Draw(screen *ebiten.Image)
func (*TouchEditScreen) Init ¶ added in v1.3.43
func (s *TouchEditScreen) Init(m *Controller) error
func (*TouchEditScreen) Update ¶ added in v1.3.43
func (s *TouchEditScreen) Update() error
type TouchEditScreenItem ¶ added in v1.3.43
type TouchEditScreenItem int