"Command Line Conflict" is a codename for a fast-paced, open-source real-time strategy game inspired by Starcraft, rendered entirely in charming ASCII art.
This guide will walk you through setting up and running the game on your local machine, as well as development best practices.
- Python 3.8 or higher
pipandvenv
To run the game manually, your system must know where to find Python. If running python --version or pip --version fails, follow these steps to add Python to your system's PATH.
- Search for "Environment Variables": Open the Start menu, type "env", and select "Edit the system environment variables".
- Environment Variables: Click the "Environment Variables..." button.
- Edit Path: In the "User variables" section, locate the row named "Path" and double-click it.
- Add Python Paths: Click "New" and add the paths to your Python executable and Scripts folder. They usually look like this (replace
YourUsernameand version number):C:\Users\YourUsername\AppData\Local\Programs\Python\Python311\C:\Users\YourUsername\AppData\Local\Programs\Python\Python311\Scripts\
- Apply: Click OK on all dialogs and restart your terminal (PowerShell or Command Prompt).
If you installed Python via the official installer, it likely set the PATH for you. If not, or if using Homebrew:
- Open your terminal.
- Edit your shell profile (e.g.,
~/.zshrcor~/.bash_profile):nano ~/.zshrc - Add the following line (adjusting for your specific installation path):
export PATH="/usr/local/bin:$PATH" # or for Homebrew on Apple Silicon: export PATH="/opt/homebrew/bin:$PATH"
- Save and exit (
Ctrl+O,Enter,Ctrl+X), then reload:source ~/.zshrc
Most Linux distributions come with Python installed. If you installed a custom version:
- Open your terminal.
- Edit your
.bashrcor.zshrc:nano ~/.bashrc - Add the export line pointing to your Python bin directory:
export PATH="/path/to/python/bin:$PATH"
- Reload the configuration:
source ~/.bashrc
-
Clone the repository:
git clone https://github.com/tsainez/command-line-conflict.git cd command-line-conflict -
Create and activate a virtual environment: This isolates the project's dependencies from your system's Python installation.
# For macOS and Linux python3 -m venv .venv source .venv/bin/activate
-
Install the required packages:
pip install --upgrade pip pip install -r requirements.txt
-
Launch the game:
python main.py
The build script creates a standalone executable using PyInstaller.
.\scripts\build_windows.ps1Optional flags:
.\scripts\build_windows.ps1 -Clean
.\scripts\build_windows.ps1 -NoVenv -Python "py"The output executable will be in the dist folder.
Before a change can be safely integrated, it must first pass through linting, automated testing, and finally a human player's assessment.
Run the checks:
```bash
# Check code formatting with Black
black --check .
# Check import sorting with isort
isort --check-only .
# Run the test suite with pytest
pytest -q
```