Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentState ¶
type CurrentState int
CurrentState is an enum that represents the current state of the game.
const ( // Running is the state when the game is running. Running CurrentState = iota // Paused is the state when the game is paused. Paused // NextWaveReady is the state when the next wave is ready. NextWaveReady )
type GameState ¶
type GameState struct { // LevelName is a name of the level. LevelName string // Map is a map of the game. Map *ingame.Map // TowersToBuy is a map of towers that can be bought. TowersToBuy map[string]*config.Tower // EnemyToCall is a map of enemies that can be called. EnemyToCall map[string]*config.Enemy // Ended is a flag that represents if the game is ended. Ended bool // Win is a flag that represents if the game is won. Win 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 // Watcher is a watcher of the game. Watcher *replay.Watcher // PlayerState is a state of the player. PlayerState *ingame.PlayerState // contains filtered or unexported fields }
GameState is a struct that represents the state of the game.
func New ¶
func New( level *config.Level, maps map[string]*config.Map, en map[string]*config.Enemy, tw map[string]*config.Tower, ps *ingame.PlayerState, w general.Widgets, ) *GameState
New creates a new entity of GameState.
Click to show internal directories.
Click to hide internal directories.