A terminal-based block stacking game
Project description
Falliant
A terminal-based block stacking game inspired by classic block stacking games, written in Python using the curses library.
Features
- Classic block-stacking gameplay
- Multiple starting levels with increasing difficulty
- Hold piece functionality
- Next piece preview
- Level progression system
- High score tracking with player initials
- Clean terminal UI with color support
Requirements
- Python 3.6+
- A terminal that supports curses and colors (most modern terminals do)
Installation
Option 1: Install from PyPI
pip install falliant
Option 2: Install from source
- Clone or download this repository
- Install directly:
# Install globally
pip install .
# Or install in user directory (no admin rights needed)
pip install --user .
Option 3: Development setup with virtual environment
- Clone or download this repository
- Set up a virtual environment and install:
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e .
How to Play
After installation, simply run:
falliant
If installed in development mode with a virtual environment, make sure the environment is activated before running the command.
Controls
- ←, ↓, → or A, S, D: Move block left, down, or right
- ↑ or W: Rotate block
- Space: Drop block to bottom
- C: Hold current block
- P: Pause/resume game
- Q: Quit to menu
Game Rules
- Arrange falling blocks to create complete horizontal lines
- Completed lines will disappear and award points
- The game speeds up as you level up
- Level increases every 10 lines cleared
- The game ends when blocks stack up to the top of the board
- If you achieve a high score, you can enter your three-letter initials
Scoring System
- 1 line: 40 × level
- 2 lines: 100 × level
- 3 lines: 300 × level
- 4 lines: 1200 × level (Falliant!)
- Top 10 high scores are tracked and saved locally
Known Issues
- Terminal resizing during gameplay may cause display issues
- Some terminals might not display colors correctly
Troubleshooting
If you encounter display issues:
- Try running in a different terminal
- Make sure your terminal supports curses and colors
- Ensure your terminal is sized appropriately (at least 80×24)
Development
Contributing
To contribute to Falliant:
- Fork the repository
- Set up a virtual environment as described in the installation section
- Make your changes
- Submit a pull request
Publishing to PyPI
Falliant uses GitHub Actions for automated publishing to PyPI. When a new release is created on GitHub, the package is automatically built and published.
To create a new release manually:
-
Update the version in
pyproject.toml -
Build the package:
python -m build
-
Upload to PyPI:
python -m twine upload dist/falliant-x.y.z*
Alternatively, use the GitHub Actions workflow:
- Create a new release on GitHub
- The GitHub Action will automatically build and publish the package
Automated Version Bumping
A GitHub workflow is available to bump versions automatically:
- Go to the Actions tab in the repository
- Select the "Bump Version" workflow
- Click "Run workflow"
- Choose the version type to bump (major, minor, patch)
- A pull request will be created with the version change
Project Structure
falliant/ # Project root
├── pyproject.toml # Package configuration
├── README.md # Documentation
├── LICENSE # MIT License
├── MANIFEST.in # Package manifest
├── .github/ # GitHub Actions workflows
├── falliant/ # Python package
│ ├── __init__.py # Package initialization
│ ├── __main__.py # Entry point
│ ├── block.py # Block class
│ ├── constants.py # Game constants
│ ├── game.py # Game logic
│ ├── renderer.py # Display functions
│ ├── ui.py # User interface
│ └── images/ # Image assets
License
This game is provided under the MIT License. See the LICENSE file for details.
Created by: Henry Sowell
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file falliant-1.0.0.tar.gz.
File metadata
- Download URL: falliant-1.0.0.tar.gz
- Upload date:
- Size: 175.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddc1c232945bc4362e9197565b61fca6fd47cbca53d28722d33a7b0b167c02ca
|
|
| MD5 |
7b47db7abe8187bca63c32b69172c4b4
|
|
| BLAKE2b-256 |
42d497be0ff12fec77ee1b25e0d9687cf03325fa59cde7af1ce557f339d7adf3
|
File details
Details for the file falliant-1.0.0-py3-none-any.whl.
File metadata
- Download URL: falliant-1.0.0-py3-none-any.whl
- Upload date:
- Size: 173.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
599fde148adc22382268ffd077321f23eb3a7e566e238059e59e6dea0e8961c1
|
|
| MD5 |
1517eb5ee67dea72339e8a775b33ccc5
|
|
| BLAKE2b-256 |
04c9bc7b09c16e6fa94eaf61284f7bf8d540a8e67e5c77bce2d3ff456c2818e4
|