Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ranchblt/statemanager
Simple statemanager for ebiten games
https://github.com/ranchblt/statemanager
Last synced: 8 days ago
JSON representation
Simple statemanager for ebiten games
- Host: GitHub
- URL: https://github.com/ranchblt/statemanager
- Owner: ranchblt
- License: mit
- Created: 2016-12-23T16:23:14.000Z (about 8 years ago)
- Default Branch: main
- Last Pushed: 2022-03-03T18:33:09.000Z (almost 3 years ago)
- Last Synced: 2024-11-07T09:46:33.366Z (about 2 months ago)
- Language: Go
- Size: 3.91 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# StateManager [![GoDoc](https://godoc.org/github.com/ranchblt/statemanager?status.svg)](https://godoc.org/github.com/ranchblt/statemanager) [![Go Report Card](https://goreportcard.com/badge/github.com/ranchblt/statemanager)](https://goreportcard.com/report/github.com/ranchblt/statemanager)
StateManager is simple state management for ebiten games## Documentation
Read [GoDoc](https://godoc.org/github.com/ranchblt/statemanager)
## Usage
```Go
stateManager := New()
stateManager.Add(menuState)
stateManager.SetActive(menuState.ID())// Main game loop function
func GameLoop(screen *ebiten.Image) error {
if err := stateManager.Update(); err != nil {
return err
}if ebiten.IsRunningSlowly() {
return nil
}if err := stateManager.Draw(screen); err != nil {
return err
}
}
```## License
[MIT License](LICENSE)