All Projects → anaseto → gruid

anaseto / gruid

Licence: ISC license
Cross-platform grid-based UI and game framework.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to gruid

elmish-getting-started
A simple and minimalistic template to easily get up and running with Elmish and Fable
Stars: ✭ 22 (-67.16%)
Mutual labels:  elm-architecture
larch
An Elm-like ClojureScript framework
Stars: ✭ 37 (-44.78%)
Mutual labels:  elm-architecture
EvOLuTIoN
A simple simulation in Unity, which uses genetic algorithm to optimize forces applied to cubes
Stars: ✭ 44 (-34.33%)
Mutual labels:  pathfinding
whistle
Experiment to build single page apps in Elixir
Stars: ✭ 52 (-22.39%)
Mutual labels:  elm-architecture
mpeiapp
MpeiX - Расписание пар, карта корпусов и личный кабинет БАРС для студентов и преподавателей НИУ МЭИ
Stars: ✭ 19 (-71.64%)
Mutual labels:  elm-architecture
Zilon Roguelike
Survival roguelike game with huge world generation.
Stars: ✭ 18 (-73.13%)
Mutual labels:  roguelikedev
FyWorld
FyWorld - Base-Building / Simulation Game & Tutorial in Unity
Stars: ✭ 207 (+208.96%)
Mutual labels:  pathfinding
UniTEA
Implementation of The Elm Architecture for Unity3D
Stars: ✭ 31 (-53.73%)
Mutual labels:  elm-architecture
elm-double-folding-pattern
Actions + Events = 🐉
Stars: ✭ 29 (-56.72%)
Mutual labels:  elm-architecture
The-Kraken-Pathfinding
A tentacle-based pathfinding library for nonholonomic robotic vehicles
Stars: ✭ 24 (-64.18%)
Mutual labels:  pathfinding
circular-obstacle-pathfinding
Pathfinding around a set of circular obstacles
Stars: ✭ 26 (-61.19%)
Mutual labels:  pathfinding
cepathfind
a path find for tilebase game in unity
Stars: ✭ 30 (-55.22%)
Mutual labels:  pathfinding
Pathfinding Visualization
A ReactJS project visualizes the path-finding algorithms with additional cool features like speed adjustment, maze generation, mobile support, etc.
Stars: ✭ 14 (-79.1%)
Mutual labels:  pathfinding
php-a-star
A* (A Star) search algorithm for PHP
Stars: ✭ 61 (-8.96%)
Mutual labels:  pathfinding
path planning GAN
Path Planning using Generative Adversarial Network (GAN)
Stars: ✭ 36 (-46.27%)
Mutual labels:  pathfinding
gotypist
A touch-typing tutor
Stars: ✭ 116 (+73.13%)
Mutual labels:  elm-architecture
cavernos
Retro fantasy terminal for building DOS-era ASCII games, powered by WebAssembly
Stars: ✭ 32 (-52.24%)
Mutual labels:  roguelikedev
a star on grids
Best practices for implementing A* with a focus on four- and eight-connected grid worlds.
Stars: ✭ 23 (-65.67%)
Mutual labels:  pathfinding
ml pathfind
Pathfind module for MTA:SA-Server
Stars: ✭ 25 (-62.69%)
Mutual labels:  pathfinding
tea-chess
A chess-themed tutorial on writing an SPA in Bucklescript-TEA
Stars: ✭ 28 (-58.21%)
Mutual labels:  elm-architecture

Gruid

pkg.go.dev godocs.io

The gruid module provides packages for easily building grid-based applications in Go. The library abstracts rendering and input for different platforms. There are drivers available for terminal apps (gruid-tcell), native graphical apps (gruid-sdl) and browser apps (gruid-js). The original application for the library was creating grid-based games, but it's also well-suited for any grid-based application.

The core gruid package uses a convenient and flexible architecture of updating a model in response to messages strongly inspired from the bubbletea module for building terminal apps, which in turn is based on the functional Elm Architecture. The architecture has been adapted to be more idiomatic in Go in the context of grid-based applications: less functional and more efficient.

You can find examples below in the Examples section.

Overview of packages

The full documentation is linked at the top of this README. We provide here a quick overview.

The gruid package defines the Model and Driver interfaces and allows to start the “update on message then draw” main loop of an application. It also defines a convenient and efficient slice grid structure to represent the logical contents of the screen and manipulate them.

The ui package defines common UI widgets and utilities: menu/table widget, pager, text input, label, styled text drawing facilities and replay functionality.

The tiles package contains helpers for drawing fonts on images, which can be used to manage character tiles using a Driver from either gruid-sdl or gruid-js.

The paths package provides efficient implementations of some common pathfinding algorithms that are often used in grid-based games, such as roguelikes. You will find implementations of the A* and JPS algorithms, as well as Dijkstra, breadth first, and connected components maps computations. See move.go in the movement example in gruid-examples for an annotated example using JPS and the mouse.

The rl package provides some additional utilities commonly needed in grid-based games such as roguelikes. The package provides an event priority queue, two complementary field of view algorithms, map generation algorithms, as well as vault parsing and manipulation utilities.

Drivers

The tcell, sdl, and js packages in the (gruid-tcell), (gruid-sdl) and (gruid-js) modules provide specific rendering and input implementations satisfying gruid's package Driver interface. The provided terminal driver only handles full-window applications. See the README.md files in the respective repositories for specific build and deployment instructions (gruid-sdl will require SDL2, and gruid-js will require a bit of HTML and js).

Examples

The gruid-examples module offers some simple annotated examples of gruid usage.

You may want to look also into some real world examples of gruid programs:

See also

If you need to handle wide-characters, that is characters that take two cells in the terminal, you may want to look into go-runewidth.

The clipboard module may be of interest for some applications too, as copying and pasting is not handled by gruid. Note that, at this time, the clipboard module does not support the js platform, but there's at least one fork that does.

As gruid only provides a few map generation algorithms, you may be interested in the dngn module, which provides map generation algorithms too, though its representation of maps is different.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].