https://github.com/duskyelf/rpg-rs
Terminal based Rbg Game (engine)
https://github.com/duskyelf/rpg-rs
diamondguru game game-engine interpreter programming-language rust terminal-based terminal-game ui
Last synced: 14 days ago
JSON representation
Terminal based Rbg Game (engine)
- Host: GitHub
- URL: https://github.com/duskyelf/rpg-rs
- Owner: DuskyElf
- License: mit
- Created: 2022-09-23T15:31:28.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-05-02T14:04:52.000Z (about 2 years ago)
- Last Synced: 2025-04-02T20:38:25.482Z (3 months ago)
- Topics: diamondguru, game, game-engine, interpreter, programming-language, rust, terminal-based, terminal-game, ui
- Language: Rust
- Homepage:
- Size: 41 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Terminal Based Rpg Game (Engine)
### In it's early stages of development### Quick Start
```shell
$ git clone [email protected]:DuskyElf/rpg-rs.git
$ cd rpg-rs
$ git checkout tags/v0.0.1-alpha
```### Sample Program
```
"Hello, World! This is just so awesome!!!"
?0 "What is your name?"
"Which Branch?" {
"first" => {
?1 "What is your age?"
"Hi $0, you are $1 years old!"
}"second" => {
"Are you 18+ $0?" {
"yes" => { "Whooo, you can vote" }
"no" => { "Sorry, you can't vote" }
}
}
}
```### Quick Run
```shell
$ cargo r --release test.rpg
```### Features that are currently implemented
- Variables
- Asking question into a variable (identifier)
- Branching System## Rpg lang Reference
### Messages
Currently, it clears the terminal and animates the message as it being typed, then stops for the user to proceed.
```
"Example message"
```
### Questions
Currently, it clears the terminal and animtes the question as it being typed, then stops for the user to type in the answer till a newline. Then saves the answer in the variable index provided (`0` in the following example).
```
?0 "What's your name?"
```
### Variables
As stated above, [questions](#questions) save the answer in the variable index provided. Those values could be accessed via the index as `$` inside a quotes.
```
?0 "What's your name?"
"Hi $0!"
```

|
### Branches
Currently, it's able to ask a question then show the possible options to select, on the basis of which it branches the code flow.
```
"Select an option -" {
"First" => {
"You selected the first branch!"
}
"Second" => {
"You selected the second branch!"
}
}
```
