replaystate

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Paused is a state that represents the game is paused.
	Paused = CurrentState(iota)

	// Running is a state that represents the game is running.
	Running
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentState

type CurrentState int

CurrentState is a type that represents the current state of the game.

type ReplayState

type ReplayState struct {
	// Map is a map of the game.
	Map *ingame.Map

	// EnemyToCall is a map of enemies that can be called.
	EnemyToCall map[string]*config.Enemy

	// TowerToBuy is a map of towers that can be bought.
	TowerToBuy map[string]*config.Tower

	// Ended is a flag that represents if the game is ended.
	Ended bool

	// State is a current state of the game.
	State CurrentState

	// UI is a UI of the game.
	UI *ebitenui.UI

	// CurrentWave is a number of the current wave.
	CurrentWave int

	// GameRule is a game rule of the game.
	GameRule ingame.GameRule

	// Time is a time of the game.
	Time general.Frames

	// PlayerMapState is a state of the player on the map.
	PlayerMapState ingame.PlayerMapState
	// contains filtered or unexported fields
}

ReplayState is a struct that represents the state of the game.

func New

func New(
	w *replay.Watcher,
	cfg *config.Level,
	maps map[string]*config.Map,
	tw map[string]*config.Tower,
	en map[string]*config.Enemy,
	widgets general.Widgets,
) *ReplayState

New creates a new entity of ReplayState.

func (*ReplayState) Action

func (r *ReplayState) Action()

Action performs the action.

func (*ReplayState) Draw

func (r *ReplayState) Draw(screen *ebiten.Image)

Draw draws the game.

func (*ReplayState) End

func (r *ReplayState) End() bool

End returns true if the game is ended.

func (*ReplayState) Update

func (r *ReplayState) Update() error

Update updates the game.

Jump to

Keyboard shortcuts

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