A strategic two-player drawing game built with C++ and Raylib where players take turns drawing flight paths between terminals while avoiding collisions with existing paths.
Airplane Paths is a competitive drawing game that challenges players' strategic thinking and precision. Players alternate turns drawing continuous paths between airport terminals (represented as dots) on the screen. The objective is to successfully connect terminals while avoiding any contact with previously drawn paths. One wrong move results in an immediate loss!
- Two-Player Gameplay: Alternating turns between Player 1 (Blue) and Player 2 (Red)
- Real-time Path Drawing: Smooth, continuous line drawing that follows mouse movement
- Collision Detection: Instant game-over detection when paths intersect
- Strategic Gameplay: Requires planning and spatial awareness to avoid existing paths
- Clean Visual Interface: Simple, intuitive design with clear player indicators
- Starting a Path: Click on any terminal (black dot) to begin drawing your flight path
- Drawing: Move your mouse to draw a continuous line from the starting terminal
- Completing a Path: Hover over another terminal to complete your path
- Winning: Successfully complete paths while your opponent crashes into existing lines
- Losing: Touch any part of a previously drawn path during your turn
- Players must start and end their paths at terminals
- Paths cannot intersect with any existing paths
- The game ends immediately when a collision is detected
- The player who causes a collision loses the game
AirplanePaths/
├── .gitignore # Git ignore rules for build files and OS artifacts
├── Makefile # Build configuration and compilation rules
├── README.md # Project documentation
├── headers/ # Header files (.hpp)
│ ├── Constants.hpp # Game constants and configuration values
│ ├── Dot.hpp # Terminal/dot structure and methods
│ ├── Path.hpp # Path structure for flight routes
│ └── Utils.hpp # Utility functions and helpers
├── main/ # Main application files
│ └── Main.cpp # Entry point and game loop
├── source/ # Implementation files (.cpp)
│ ├── Dot.cpp # Terminal functionality implementation
│ ├── Path.cpp # Path drawing and management
│ └── Utils.cpp # Utility functions implementation
├── obj/ # Compiled object files (created during build)
└── game/ # Final executable output directory
└── AirplanePaths.exe # Compiled game executable
- Constants.hpp: Defines screen dimensions, colors, dot radius, and other game constants
- Dot.hpp: Structure for terminal points with click detection and rendering methods
- Path.hpp: Structure for flight paths including drawing states and player ownership
- Utils.hpp: Utility functions for point generation and collision detection
- Dot.cpp: Implements terminal rendering, click detection, and hover detection
- Path.cpp: Handles path creation, real-time drawing, and rendering
- Utils.cpp: Point generation with spacing constraints and collision detection logic
- Main.cpp: Contains the game loop, event handling, UI rendering, and game state management
- Install a C++ compiler (e.g., GCC or MinGW for Windows).
- Install Raylib (a simple and easy-to-use library for game development).
- Ensure you have a terminal or command prompt to run commands.
- Clone or download the project
- Navigate to project directory
- Run the following command to compile the game:
make all- Or use this command to compile and run the game in one step:
make runTo remove compiled files and clean the project, run:
make clean- Raylib: Cross-platform game development library
- C++17: Modern C++ standard for enhanced features and performance
- Standard Library: Vector containers for dynamic path storage
- Makefile: Automated compilation with dependency management
- Object Files: Separate compilation for faster incremental builds
- Static Linking: Self-contained executable with embedded libraries
- Modular Design: Separate classes for game entities (Dot, Path)
- Global State Management: Centralized game state with extern variables
- Event-Driven: Mouse input handling with real-time response
- Memory Management: Dynamic allocation for active path creation
- Multi-Player Support: Scale the game from 2 players to support 2-4 players simultaneously
- Enhanced Color Coding: Additional distinct colors for 3rd and 4th players
- Airplane Cursor: Replace the default mouse pointer with airplane images that rotate based on movement direction
- Animated Terminals: Add pulsing or glowing effects to available terminals
- Background Themes: Multiple visual themes including sky, night, or radar-style backgrounds