A terminal-based block stacking game inspired by classic block stacking games, written in Python using the curses library.
- 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
- Python 3.6+
- A terminal that supports curses and colors (most modern terminals do)
pip install falliant- Clone or download this repository
- Install directly:
# Install globally
pip install .
# Or install in user directory (no admin rights needed)
pip install --user .- 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 .After installation, simply run:
falliantIf installed in development mode with a virtual environment, make sure the environment is activated before running the command.
- ←, ↓, → 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
- 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
- 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
- Terminal resizing during gameplay may cause display issues
- Some terminals might not display colors correctly
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)
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
We follow Semantic Versioning (SemVer):
- MAJOR.MINOR.PATCH (e.g.,
1.0.1)- MAJOR: Breaking changes
- MINOR: New features, backwards compatible
- PATCH: Bug fixes, documentation updates
The version number is synchronized across GitHub and PyPI through these rules:
pyproject.tomlis the source of truth for version numbers- GitHub Releases/tags must match the version in
pyproject.toml - PyPI releases are only triggered by GitHub Releases
- The Bump Version workflow ensures all these stay in sync
-
Automated Method (Preferred)
- Go to GitHub Actions
- Select "Bump Version" workflow
- Click "Run workflow"
- Choose version type:
patch: Bug fixes (1.0.0 → 1.0.1)minor: New features (1.0.0 → 1.1.0)major: Breaking changes (1.0.0 → 2.0.0)
- Review and merge the created pull request
- After merge, create a GitHub Release to trigger PyPI publish
-
Manual Method
# Update version in pyproject.toml git add pyproject.toml git commit -m "bump: version X.Y.Z → X.Y.Z" git push origin main # Create and push tag git tag -a vX.Y.Z -m "version X.Y.Z" git push origin vX.Y.Z
-
Pre-release Checklist
- All tests passing
- Documentation updated
- Version number updated in
pyproject.toml - All changes committed and pushed
-
Creating the Release
- Go to Releases page on GitHub
- Click "Draft a new release"
- Choose or create tag matching version (e.g.,
vX.Y.Z) - Fill in release details
- Click "Publish release"
-
Automated Publishing The GitHub Actions workflow will automatically:
- Build the package
- Publish to PyPI using trusted publisher
- Make the release available on PyPI
-
Post-release Verification
-
Check GitHub release page
-
Verify on PyPI
-
Test installation:
python -m venv test_env source test_env/bin/activate # On Windows: test_env\Scripts\activate pip install falliant==X.Y.Z falliant # Test basic functionality
-
- Changes to workflow files (
.github/workflows/*) don't require version bumps - Documentation-only changes typically use a PATCH version bump
- PyPI releases only happen when GitHub Releases are created
- Always ensure GitHub Release tags match the version in
pyproject.toml - The Bump Version workflow helps maintain this synchronization automatically
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 assetsThis game is provided under the MIT License. See the LICENSE file for details.
Created by: Henry Sowell
