https://github.com/r7ronquillo/collision-distance-sdl
Basic 2D AABB collision and distance calculation with SDL.
https://github.com/r7ronquillo/collision-distance-sdl
c c-programming collision-detection sdl
Last synced: 12 days ago
JSON representation
Basic 2D AABB collision and distance calculation with SDL.
- Host: GitHub
- URL: https://github.com/r7ronquillo/collision-distance-sdl
- Owner: r7ronquillo
- License: mit
- Created: 2025-04-17T18:50:30.000Z (18 days ago)
- Default Branch: main
- Last Pushed: 2025-04-17T22:48:06.000Z (18 days ago)
- Last Synced: 2025-04-23T21:15:42.606Z (12 days ago)
- Topics: c, c-programming, collision-detection, sdl
- Language: C
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 2D AABB Collision Detection with SDL
## Overview
This project is a simple 2D AABB (Axis-Aligned Bounding Box) collision detection program written in **C** using the **Simple DirectMedia Layer (SDL)** library. It includes:
- **Point-in-Box Collision:** Detects if the mouse cursor is inside a rectangle.
- **Box-in-Box Collision:** Detects if two rectangles overlap.
- **Distance Calculations:** Calculates the distance between the mouse and a fixed box, as well as the distance between two moving boxes.
- **Real-Time Interaction:** One rectangle follows the mouse, with an option to toggle this behavior.
## Dependencies
This project requires **SDL3** for rendering, input handling, and window management.**Installing SDL:**
- Visit the official SDL website: [https://github.com/libsdl-org/SDL](https://github.com/libsdl-org/SDL)**Note:** This project uses SDL3 and was built using the C17 standard. Development and testing were performed on Windows 11 with Visual Studio 2022. Compatibility with other platforms (Linux, macOS) has not been tested.
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.