Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.86 KB

README.md

File metadata and controls

46 lines (31 loc) · 1.86 KB

rusty_pong

  • 👾 Simple terminal based implementation of Pong
  • 🚀 My first project in Rust!
  • 📚 Uses (mostly) what I learned in the Udemy course Ultimate Rust Crash Course by @CleanCut (Nathan Stocks)
  • ‍💻️ Based on the invaders example repo but redone from scratch
  • 🤓 I can recommend building the same to solidify learning after taking the course. The project is similar but different enough.

Comments

Where are the sounds coming from?

All sounds are taken from the invaders example projects because I am lazy and no fun.

Why are the controls so bad? Why do player controls interrupt each other?

Handling of key presses and especially key releases are surprisingly difficult in terminals. It is a rabbit hole which I did not jump fully in. There are some workarounds to make it work. Using certain terminal implementations (e.g. kitty) and activating support in crossterm (see here) would make it possible, but I did not bother for this learning project.

Dependencies on Linux

Audio should work out-of-the-box on macOS, Windows, and iOS. For Linux, the downstream package for actually playing sound ([CPAL]) requires the Alsa development libraries to be installed.

CentOS

sudo yum install -y alsa-lib-devel

Debian/Ubuntu

sudo apt install libasound2-dev pkg-config

Contribution

All contributions are assumed to be dual-licensed under MIT/Apache-2.

License

Distributed under the terms of both the MIT license and the Apache License (Version 2.0).

See license/APACHE and license/MIT.