Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/tversteeg/siege

:bow_and_arrow: Procedural siege engine generator
https://github.com/tversteeg/siege

castle-game pixel-art rust

Last synced: 3 months ago
JSON representation

:bow_and_arrow: Procedural siege engine generator

Awesome Lists containing this project

README

        

siege



Procedurally generate siege engines.




CI
Version
Rust Documentation
License


This library allows you to procedurally generate new siege engines using a template. This template can be defined in code or from as an ASCII string.

The `ascii` example can be used to showcase this:

`example.ascii` contains the following text:

> ```
> +-------+
> |.......|
> |.......|
> |.......|
> |.......+----+
> |.......|
> |.......|
> |.......|
> o---o---o
> ```

When we run the example from the command line:

```sh
cargo run --example ascii src/example.ascii -w 7 -h 10
```

We might get this as an output:

> ```
> +--+
> |..|
> |..|
> |..+--+
> |..|
> |..|
> o--o
> ```

The `'*'` symbol can be used to let the algorithm automatically choose what edges to use:

```sh
cargo run --example ascii src/example2.ascii -w 20 -h 10
```

`example2.ascii`:

> ```
> ****
> ****
> ****
> *********
> *********
> *********---
> *********
> *********
> o***o***o
> ```

Might result in:

> ```
> +--+
> |..|
> +--+ |..+--+
> |..| |.....|
> |..| |.....+-------
> |..+--+.....|
> |...........|
> |...........|
> |...........|
> o-----------o
> ```