Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/philschatz/puzzlescript-rust

:video_game: Play PuzzleScript games in Rust
https://github.com/philschatz/puzzlescript-rust

game game-engine puzzle-game puzzles rust

Last synced: 2 months ago
JSON representation

:video_game: Play PuzzleScript games in Rust

Awesome Lists containing this project

README

        

# What is this?

It is a [PuzzleScript][puzzlescript-url] interpreter written in Rust to play games in your terminal!

## Try it out!

[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/from-referrer/)

# Screencaps

Here are some screencaps of games being played.

### Gravirinth ([original](https://pedropsi.github.io/gravirinth.html))

(click to see the ascii screencast)

video of the beginning of Gravirinth

### Mirror Isles ([original](http://www.draknek.org/games/puzzlescript/mirrors.php))

This screencast shows playing the game in a terminal using ASCII and ANSI colors.

![mirror-isles](https://user-images.githubusercontent.com/253202/47133542-ce0d1700-d26e-11e8-851f-233d27aaf0b8.gif)

### Pot Wash Panic! ([original](https://hauntpun.itch.io/pot-wash-panic))

(click to see the ascii screencast)

video of install and a couple games

### Hack the Net ([original](http://www.draknek.org/games/puzzlescript/hack-the-net.php))

video of a couple levels of Hack-the-Net

### Skipping Stones to Lonely Homes ([original](http://www.draknek.org/games/puzzlescript/skipping-stones.php))

video of the beginning of Skipping Stones (BIG)

### Entanglement ([original](http://www.richardlocke.co.uk/release/entanglement/chapter-1/))

video of the beginning of Entanglement

# Install

1. Install Rust
1. Clone this repository
1. Run `cargo run --release` to get the help message
1. Run `cargo run --release -- ./games/{game}.parsed.json` to play a game
- As you complete levels, it will create a save file in the same directory as the game

# Test

- `./test.bash` : runs all the tests
- `cargo test` : runs unit tests
- `./test_solutions.bash` : replays real games and verifies the solutions still work

## Flamegraph

Flamegraphs are great for finding performance problems. Here's how to generate one:

```bash
echo "DDD" | sudo cargo flamegraph ./games/roll-those-sixes.parsed.json -- --level 0 --scripted
echo "S.D.S.D.DWAASAWWW..............q" | sudo cargo flamegraph ./games/entanglement-one.parsed.json -- --level 3 --scripted
```

# TODO

- [ ] Build WebAssembly version and add example of using it in a browser
- [ ] Add a parser so the original `script.txt` files can be used instead of the `*.parsed.json` files

[puzzlescript-url]: https://github.com/philschatz/puzzlescript