An open API service indexing awesome lists of open source software.

https://github.com/charlesaverill/terrasim

A SimEarth clone in OCaml using tsdl and tgls
https://github.com/charlesaverill/terrasim

opengl procedural-generation sdl2 simulation video-game

Last synced: about 2 months ago
JSON representation

A SimEarth clone in OCaml using tsdl and tgls

Awesome Lists containing this project

README

          

# TerraSim

![logo](https://github.com/CharlesAverill/terrasim/raw/main/assets/logo/logo.png)

A SimEarth clone in OCaml using [tsdl](https://erratique.ch/software/tsdl) and [tgls](https://erratique.ch/software/tgls).

See [roadmap.md](https://github.com/CharlesAverill/terrasim/blob/main/roadmap.md) for progress

## Building

```bash
git clone https://github.com/CharlesAverill/terrasim.git && cd terrasim

# Dependencies
sudo apt install libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev libffi-dev libgmp-dev
git submodule update --init --recursive
opam install . --deps-only

dune build
```

To run, simply

```bash
dune exec TerraSim
```

## Controls

There are three views right now:

### Edit view (Cartesian)

| Input | Effect |
|---|---|
| Mouse move | Pan view |
| Mouse click | Run command denoted by highlighted UI button |
| `c` | Switch to Atlas view |
| `h` | Hide the UI |

### Atlas view (Cartesian)

| Input | Effect |
|---|---|
| Mouse move | Pan view |
| `c` | Switch to Globe view |

### Globe view (Orthographic)

| Input | Effect |
|---|---|
| Click and drag | Spin globe |
| `c` | Switch to Edit view |