A simple, elegant terminal game engine written in Go that provides a foundation for building interactive terminal applications and games.
- Event-driven architecture with Model-View-Update pattern
- Terminal input handling with support for arrow keys and special characters
- Flexible rendering system with double buffering and ANSI escape sequences
- Animation support with frame-based animations
- Localization support with JSON-based language files
- Alternate screen mode for full-screen applications
- Simple API that's easy to learn and use
- Compositing multiple layer for ui's
- Mouse support
go get github.com/skyvence/TerminalEngineGo
package main
import (
"github.com/skyvence/TerminalEngineGo"
)
type model struct {
content string
}
func (m model) Init() engine.Msg {
return nil
}
func (m model) Update(msg engine.Msg) (engine.Model, engine.Cmd) {
switch msg := msg.(type) {
case engine.KeyMsg:
if msg.Rune == 'q' {
return m, func() engine.Msg { return engine.Quit() }
}
}
return m, nil
}
func (m model) View() string {
return "Hello, Terminal Engine! Press 'q' to quit.\n"
}
func main() {
m := model{content: "Hello World"}
p := engine.NewProgram(m)
p.Run()
}
For detailed documentation, see the docs directory:
Check out the examples repository for practical implementations
- Currently in the process of remaking the example in the new repository
- Old example are still accessible in older example
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG.md for version history and changes.