Back to godoc.org

Package scenes

v0.0.3
Latest Go to latest

The latest major version is .

Published: Feb 26, 2020 | License: Apache-2.0 | Module: github.com/kemokemo/kuronan-dash

Index

type GameState

type GameState struct {
	SceneManager *SceneManager
	Input        *input.Input
}

GameState describe the state of this game.

type Scene

type Scene interface {
	Initialize() error
	Update(state *GameState) error
	Draw(screen *ebiten.Image) error
	StartMusic() error
	StopMusic() error
}

Scene is interface for the all scenes.

type SceneManager

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

SceneManager manages all scenes.

func NewSceneManager

func NewSceneManager() (*SceneManager, error)

NewSceneManager returns a new SceneManager.

func (*SceneManager) Draw

func (s *SceneManager) Draw(r *ebiten.Image)

Draw draws background and characters. This function play music too.

func (*SceneManager) GoTo

func (s *SceneManager) GoTo(scene Scene) error

GoTo sets resources to the new scene and change the current scene to the new scene. This stops the music of the current and starts the music of the next.

func (*SceneManager) Update

func (s *SceneManager) Update(input *input.Input) error

Update updates the status of this scene.

type SelectScene

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

SelectScene is the scene to select the player character.

func (*SelectScene) Draw

func (s *SelectScene) Draw(screen *ebiten.Image) error

Draw draws background and characters.

func (*SelectScene) Initialize

func (s *SelectScene) Initialize() error

Initialize initializes all resources.

func (*SelectScene) StartMusic

func (s *SelectScene) StartMusic() error

StartMusic starts playing music

func (*SelectScene) StopMusic

func (s *SelectScene) StopMusic() error

StopMusic stops playing music

func (*SelectScene) Update

func (s *SelectScene) Update(state *GameState) error

Update updates the status of this scene.

type Stage01Scene

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

Stage01Scene is the scene for the 1st stage game.

func (*Stage01Scene) Close

func (s *Stage01Scene) Close() error

Close stops music

func (*Stage01Scene) Draw

func (s *Stage01Scene) Draw(screen *ebiten.Image) error

Draw draws background and characters.

func (*Stage01Scene) Initialize

func (s *Stage01Scene) Initialize() error

Initialize initializes all resources.

func (*Stage01Scene) StartMusic

func (s *Stage01Scene) StartMusic() error

StartMusic starts playing music

func (*Stage01Scene) StopMusic

func (s *Stage01Scene) StopMusic() error

StopMusic stops playing music

func (*Stage01Scene) Update

func (s *Stage01Scene) Update(state *GameState) error

Update updates the status of this scene.

type TitleScene

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

TitleScene is the scene for title.

func (*TitleScene) Draw

func (s *TitleScene) Draw(r *ebiten.Image) error

Draw draws background and characters.

func (*TitleScene) Initialize

func (s *TitleScene) Initialize() error

Initialize initializes all resources.

func (*TitleScene) StartMusic

func (s *TitleScene) StartMusic() error

StartMusic starts playing music

func (*TitleScene) StopMusic

func (s *TitleScene) StopMusic() error

StopMusic stops playing music

func (*TitleScene) Update

func (s *TitleScene) Update(state *GameState) error

Update updates the status of this scene.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier