It was a fun project that helped me learn more about the ANSI/ASCII characters and terminal input/output manipulation. Besides that it was my first Ruby project so this way I could learn about its syntax, thought process behind the language and I could try something new.
Windows CMD and PowerShell aren't aware of the concept of getting user input without blocking the program so the games might not work properly. The easiest workaround is to run a second thread responsible only for user input.
Clone the GitHub repository into the current folder:
git clone https://github.com/Me-Wosh/TerminalGames.git
Navigate to the specific game folder (SpaceInvaders / Snake):
Run program with ruby:
ruby main.rb
To check if you have ruby installed type:
ruby -v
If you don't have ruby installed I recommend installing it while using a manager (rbenv, chruby, etc.), especially if you are on macOS
More installation info: https://www.ruby-lang.org/en/documentation/installation/
- Moving player character
- Shooting at enemies
- Enemies moving at intervals and shooting back at the player
- Special faster enemy that spawns once in a while and rewards bonus points if shot
- Shields that block both enemies and player bullets
- 3 lives that can regenerate if certain conditions are met
- Level ups
1080p.mov
- 2 Game modes - classic and speed
- Collision with body and border
- Menu
- Eating food to grow in size
- Game over screen