Skip to content

SkyVence/TerminalEngineGo

Repository files navigation

TerminalEngineGo

Version Go Version License GitHub Actions Workflow Status

A simple, elegant terminal game engine written in Go that provides a foundation for building interactive terminal applications and games.

Features

  • 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

Features planned

  • Compositing multiple layer for ui's
  • Mouse support

Installation

go get github.com/skyvence/TerminalEngineGo

Quick Start

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()
}

Documentation

For detailed documentation, see the docs directory:

Examples

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

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changelog

See CHANGELOG.md for version history and changes.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages