A never-ending, auto-animated bouncing ball with dynamic obstacle collision and line clipping logic.
⚠️ Note: This project must be run on Turbo C++ using Borland Graphics Interface (BGI). Use Turbo C++ or an emulator like DOSBox for accurate execution.
This C++ graphics project features a ball endlessly bouncing within a rectangular window. A horizontally moving bar (obstacle) traverses the screen, and whenever the ball collides with it, it gets deflected.
What makes this simulation unique is that the bar is clipped using the Cohen-Sutherland Line Clipping Algorithm — a graphics classic — ensuring it’s only visible when inside the boundary box.
It’s a clean, continuous visual simulation — ideal for understanding clipping, bouncing logic, and retro animation techniques.
Technology | Purpose |
---|---|
C++ | Game and animation logic |
BGI (Borland Graphics Interface) | Rendering graphics inside Turbo C++ |
Turbo C++ / DOSBox | Environment required to run graphics code |
- 🔁 Ball bounces infinitely within a rectangular window
- 📏 Cohen-Sutherland Line Clipping algorithm applied to the obstacle (bar)
- 🧱 Bar moves horizontally across the screen and is clipped at the window bounds
- 💥 When ball and bar collide, the ball deflects dynamically
- 🕹️ No game logic or scoring — pure animated simulation for visual learning
- Understood and applied the Cohen-Sutherland algorithm in a live environment
- Learned basic animation with graphics in Turbo C++
- Implemented real-time collision detection
- Practiced drawing and clipping graphical elements using legacy tools
- Gained confidence in creating interactive 2D simulations in C++
Sumdiboii – Retro Coder, Animation Wizard & Algorithm Addict 💻✨
LinkedIn – Sumedh Pimplikar
Sometimes, the best way to learn is to build something endless. This project isn't just code — it's a motion experiment in logic and legacy tech. 🚀