Sista¶
Sista is a lightweight and easy-to-use object-oriented library for handling terminal graphics in C++.
Sista provides a set of classes and functions to make terminal games in C++ easier, thus preventing developers from having to reinvent the wheel every time they want to make a terminal game.
Download¶
To install Sista, simply download the latest release from GitHub. Extract the contents of the archive to your project’s source directory.
An easier approach can be to directly clone the repository into your project’s directory.
git clone https://github.com/FLAK-ZOSO/Sista
If you want to use Sista as a shared library without installing it from source, you can download the x86-64 library from the latest release on GitHub. Then, just rename it to libSista.so and place it in your system library path (e.g., /usr/local/lib on Linux and MacOS, or C:Program FilesSistalib on Windows).
Usage¶
The way you use Sista depends on how you want to include it in your project. There are two main ways to use Sista:
As a source library
As a shared library
In the first case, you will include the Sista headers in your project and compile the source files along with your project. In the second case, you will install Sista as a shared library and link against it when compiling your project.
As a source library¶
To use Sista, simply include the "sista.hpp" header in your project’s source files. This is the inclusion method for versions before v`2.0.0`.
#include "include/sista/sista.hpp"
The "sista.hpp" header includes all of the other headers in the "include/sista/" directory, so you don’t have to include them individually.
However, you will have to include them in the compilation process as shown here.
IMPLEMENTATIONS = include/sista/ansi.cpp include/sista/border.cpp include/sista/coordinates.cpp include/sista/cursor.cpp include/sista/field.cpp include/sista/pawn.cpp
all: objects file clean
objects:
g++ -std=c++17 -Wall -g -c $(IMPLEMENTATIONS)
sista: objects
g++ -std=c++17 -Wall -g -c sista.cpp
g++ -std=c++17 -Wall -g -o sista sista.o ansi.o border.o coordinates.o cursor.o pawn.o field.o
clean:
rm -f *.o
This assumes that you have the include/sista/ directory in your project’s source directory, and that sista.cpp is the only file of your project that uses Sista.
For more complex projects, you can use a build system like CMake or Make to manage the compilation process.
You can likely find a good example of a Makefile for a statically linked from source Sista project at Inävjaga.
Documentation¶
Most of the documentation can be found here on Read the Docs: Sista Documentation.
Doxygen documentation - auto-generated API reference
Sista Python API - PyDoc for the Python module
Old Sista reference - old library documentation
Introduction - documented example
The present documentation focuses on a legacy unmaintained release of Sista, which is version 2.y.z.
Some additional documentation for Sista can be found in the Release Notes on GitHub.
Introduction¶
A simple example of how to use Sista to make a terminal animation is provided by sista.cpp.
A more detailed explaination of the example can be found in the intro.
Demos¶
You can find some demos of Sista in the demo directory of the repository.
These demos showcase various features of Sista. They are minimal examples and, unlike the sista.cpp example, they do not provide a complete walkthrough of the library.
Derived works¶
Here are some of the most relevant works based on Sista, which you can use as a base for your project or as examples to better understand the syntax coming with the library.
Inomhus - Bättre att stanna inomhus (better be in the house) - a survival videogame
Starklag - den starkastes lag (the law of the strongest) - a partial evolution simulator
Dödas - de dödas angrepp (attack of the dead) - a survival speedrun videogame
Dune - a survival videogame inspired by Dune
Inävjaga - Inälvor jagade (intestin hunt) - a survival videogame with hordes of enemies