Skip to main content

Space Invaders in your console

Project description

Console Invaders

A text-mode space invaders game (suggested from Austin Z. Henley's blog).

Install

Install by runing:

pip install consoleinvaders

Uses pynput and windows-curses dependencies.

Run

To play the game use arrow keys to move, and hold Left Shift to shoot, run on a terminal:

consoleinvaders

The game is over if you destroy all aliens or an alien destroys you or reaches the bottom.

Press ESC or Ctrl+C to quit.

Windows

The Windows Terminal doesn't seem to handle resizing while the game is running: microsoft/terminal#5094

MacOS

In order to detect keyboard state, your terminal needs Input Monitoring permission.

For some reason, when using iTerm2 the keyboard state doesn't work if iTerm2 is selected. Click to focus a different app and then play the game, or use a different terminal.

Developing

git clone https://github.com/darthwalsh/ConsoleInvaders.git
cd ConsoleInvaders
python3 -m venv env   # Or on Windows, use python
. env/bin/activate    # Or on Windows, use Activate.ps1
pip install -r requirements.txt

# On Windows: pip install windows-curses

Run with:

python3 -c "import consoleinvaders.app; consoleinvaders.app.main()"

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

consoleinvaders-0.1.tar.gz (5.3 kB view hashes)

Uploaded Source

Built Distribution

consoleinvaders-0.1-py2.py3-none-any.whl (6.3 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page