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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 2Python 3

File details

Details for the file consoleinvaders-0.1.tar.gz.

File metadata

  • Download URL: consoleinvaders-0.1.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.25.1

File hashes

Hashes for consoleinvaders-0.1.tar.gz
Algorithm Hash digest
SHA256 ba89bb283815cf04cfdb2b462b7dbb107737a255816f1c7ae6732af1a2cf67f8
MD5 2c0a9c1361b2245e1240dd1350aadeeb
BLAKE2b-256 22a09f1bd85cfd335de56bc2c3d1d885bf8d3555912e94728c809531edc2860f

See more details on using hashes here.

File details

Details for the file consoleinvaders-0.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for consoleinvaders-0.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 3799ce5af025ba19dd2463b079b4a34c318b21546ff060ac0aae5ed3b03662ba
MD5 44005cb80288e0deaade5d241ff70a5a
BLAKE2b-256 7491ab92a97fff0cf0bda5b64142f7e8dca1fea0e67159376f9b7784b2080f6e

See more details on using hashes here.

Supported by

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