https://github.com/noah2610/pong-cli
Play pong from your terminal!
https://github.com/noah2610/pong-cli
cli cli-game game pong
Last synced: 7 months ago
JSON representation
Play pong from your terminal!
- Host: GitHub
- URL: https://github.com/noah2610/pong-cli
- Owner: Noah2610
- License: mit
- Created: 2019-10-20T06:51:33.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-04-19T10:40:00.000Z (over 3 years ago)
- Last Synced: 2025-03-16T21:21:25.141Z (7 months ago)
- Topics: cli, cli-game, game, pong
- Language: Rust
- Homepage: https://crates.io/crates/pong-cli
- Size: 194 KB
- Stars: 11
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pong CLI
A CLI pong clone.
Uses the [`crossterm`][crossterm] and [`specs`][specs] crates.---
- [Asciicasts](#asciicasts)
- [Description](#description)
- [Installation](#installation)
- [From crates.io](#from-cratesio)
- [Binaries](#binaries)
- [From source](#from-source)
- [Configuration](#configuration)
- [Features](#features)
- [License](#license)---
## Asciicasts
## Description
Play __pong__ from your terminal!
Play against a ball-chasing AI opponent, locally against another player,
or let _two_ AIs fight it out!
Everything is configurable, see the [Configuration][readme-configuration] section.## Installation
### From [crates.io][crates.io]
You'll need to have `cargo` and `rust` version __1.38.0__ or higher installed.
Download, build, and install from [crates.io][crates.io] with ...
```
cargo install pong-cli
```
Then you should be able to run the game from anywhere with ...
```
pong-cli
```### Binaries
Binaries for Linux and Windows are available from the [releases] GitHub page.
From there, simply download the `.zip` file for your platform,
extract the archive and run the executable:
- `pong-cli` for Linux (from terminal),
or double-click the `PongCLI.desktop` file from your GUI file-manager
- `pong-cli.exe` for Windows### From source
To build the game from source, you'll need to clone the repo and compile the game using `cargo`.
You'll need to have `rust` version __1.38.0__ or higher installed.Clone the repository with ...
```
git clone https://github.com/Noah2610/pong-cli
```
`cd` into the project's root with `cd pong-cli`,
Then you can build and run the game with ...
```
cargo run --release
```
You can also install it with `cargo`, so it is available everywhere from the command-line ...
```
cargo install --path .
```## Configuration
Settings are read from a `.ron` file at one of the following locations (checked in order):
- `./settings.ron`
- `./pong-cli.ron`
- `$HOME/.pong-cli.ron`
- `$HOME/.config/pong-cli/settings.ron` (for Linux),
`$HOME/AppData/Roaming/pong-cli/settings.ron` (for Windows)
`$HOME/Library/Preferences/pong-cli/settings.ron` (for MacOS)To start, copy the default [`settings.ron`][settings.ron] file to one of these locations.
Once the `settings.ron` file is in place, you can edit it as you wish.
The file itself is commented, so just open it to see all available settings.
Download with `curl` on Linux
On Linux, you can enter the following (if you have `curl` installed), to
automatically create the proper directory/directories and download the latest `settings.ron` file:```
mkdir -p ~/.config/pong-cli
curl https://raw.githubusercontent.com/Noah2610/pong-cli/master/settings.ron > ~/.config/pong-cli/settings.ron
```## Features
| Feature | Default? | Description |
| :-------- | :------: | :---------- |
| `random` | __YES__ | Enables randomization for ball spawning directions.
See `settings.ron` file for configuration. |
| `style` | __YES__ | Adds configurable color and text styling (bold, underline, etc.) to the game.
See `settings.ron` file for configuration. |
| `nightly` | no | Enables `specs/nightly` feature for debug/development purposes. |Use `--no-default-features` to disable all features when building with `cargo build/run`.
## License
[MIT License][mit][mit]: https://github.com/Noah2610/pong-cli/blob/master/LICENSE
[crossterm]: https://github.com/crossterm-rs/crossterm
[specs]: https://github.com/amethyst/specs
[settings.ron]: https://github.com/Noah2610/pong-cli/blob/master/settings.ron
[issue-settings]: https://github.com/Noah2610/pong-cli/issues/2
[releases]: https://github.com/Noah2610/pong-cli/releases
[readme-configuration]: #configuration
[crates.io]: https://crates.io/crates/pong-cli