An air traffic control visualization system with real-time aircraft tracking and tower defense mechanics — Monitor and manage multiple aircraft routes across a radar display while detecting collisions with defense tower coverage zones.
My Radar 2 is a CSFML-based graphical simulation that visualizes aircraft movements across a radar display. The system reads configuration files defining aircraft flight paths and radar towers, then displays animated aircraft moving from departure to arrival points. The application includes real-time collision detection, visual tower coverage zones, and an elapsed time counter.
🛩️ Flight Operations:
✈️ Multiple Aircraft - Handle dozens of simultaneously active aircraft- 📍 Waypoint Navigation - Aircraft travel from departure to arrival coordinates
- ⏱️ Delayed Activation - Aircraft spawn after configurable delay periods
- 🎯 Speed Control - Each aircraft has independent speed parameters
- 💥 Collision Detection - Detects aircraft hits in tower detection zones
- 🗼 Radar Towers - Defend against aircraft entering coverage zones
- 📡 Visual Coverage Zones - Display tower detection radius on screen
- 🎨 Dynamic Rendering - Toggle hitbox visualization for debugging
- 🖼️ Animated Background - Radar-style display background
- ⏲️ Elapsed Time Display - Real-time countdown/timer overlay
- 📊 Hit Status Tracking - Visual feedback for destroyed aircraft
- 🔊 Background Music - Atmospheric audio during simulation
MyRadar2/
├── src/ # Main source files
│ ├── my_radar.c # Main application loop
│ ├── init.c # Game/window initialization
│ ├── plane.c # Aircraft data parsing & creation
│ ├── tower.c # Tower data parsing & creation
│ ├── graphics.c # Rendering pipeline
│ ├── background.c # Background sprite management
│ ├── help.c # Help menu & usage info
│ └── cleanup.c # Resource deallocation
├── include/
│ └── my.h # Main header with data structures
├── extras/
│ ├── my_printf/ # Custom printf implementation
│ └── other_functions/ # String utilities
├── content/ # Game assets
│ ├── background.jpg # Radar display background
│ ├── plane.png # Aircraft sprite
│ ├── tower.png # Tower sprite
│ ├── music.mp3 # Background music
│ └── font.ttf # Text font
└── Makefile
- aircraft_t - Aircraft with departure/arrival points, speed, delay, position tracking, and collision state
- tower_t - Radar tower with position and detection radius
- game_t - Global game state (window, clock, aircraft list, tower list, rendering data)
- vector2f_t - 2D floating-point position/velocity vectors
- aircraft_data_t - Parsed aircraft configuration from file
- tower_data_t - Parsed tower configuration from file
# Build the application
make
# Clean object files
make clean
# Remove all build artifacts
make fclean
# Rebuild from scratch
make re
# Build with debug symbols
make debug
# Run with configuration file
./my_radar path/to/config.txt- Compiler: GCC with C99 support
- Dependencies:
- CSFML libraries (graphics, system, window, audio)
- libm (math library)
- Standard C libraries
A <x1> <y1> <x2> <y2> <speed> <delay>
x1, y1- Departure coordinates (pixels)x2, y2- Arrival coordinates (pixels)speed- Movement speed (pixels per unit time)delay- Frames before aircraft becomes active
T <x> <y> <radius>
x, y- Tower center position (pixels)radius- Detection zone radius (pixels)
A 100 100 800 600 5 10
A 200 50 900 400 3 5
T 400 300 100
T 600 500 150
./my_radar <config_file>
./my_radar -h # Display help information- Close Window - Exit the application
- Visual Debug - Press keys to toggle sprite/hitbox display (implementation dependent)
- Configuration Loading - Parse aircraft and tower definitions from file
- Sprite Creation - Load and position aircraft and tower graphics
- Simulation Loop - Update aircraft positions each frame
- Collision Check - Test if any aircraft position overlaps tower zones
- Rendering - Draw background, towers, aircraft, and timer
- Output - Display destroyed aircraft markers and elapsed time
- Lines of Code: ~536 (core game files)
- Project Size: ~9.8MB (includes assets)
- Language: C (C99 standard)
- Graphics Library: CSFML
- Build System: Make
- Asset Format: PNG sprites, JPG background, MP3 audio
✨ Key Features:
- Linked List Management - Efficient aircraft and tower storage
- Collision Detection - Distance-based radius checking
- Delta Time Rendering - Frame-rate independent movement
- File Parsing - Robust configuration file handling
- Global Game State - Centralized state management
- Memory Efficiency - Proper allocation and cleanup
- Initialization Phase - Load window, music, assets, and parse config
- Aircraft Spawn - Activate aircraft after delay period
- Movement Phase - Update aircraft positions toward destination
- Detection Phase - Check for tower zone collisions
- Rendering Phase - Draw current game state
- Cleanup - Free all allocated resources on exit
- Support for multiple simultaneous aircraft routes
- Real-time visual feedback for collisions
- Configurable tower defense zones
- Elapsed time tracking
- Background music and audio
- High-resolution graphics rendering
- The application uses a global
game_tpointer for state management - Aircraft movement is linear interpolation between waypoints
- Tower coverage is circular with configurable radius
- Configuration files must follow strict format (A/T prefixes)
- The timer displays total elapsed simulation time
Epitech Graphical Programming Project (2025)
Project Type: Simulation / Graphics Programming
Difficulty: Intermediate
Key Concepts: File Parsing, Spatial Simulation, Collision Detection, Real-Time Rendering