https://github.com/kodesun/bouncy-ball
SFML application that simulates real-world physics utilizing a bouncy ball that you can interact with 📐🎱
https://github.com/kodesun/bouncy-ball
bouncy-ball physics-simulation sfml-game
Last synced: over 1 year ago
JSON representation
SFML application that simulates real-world physics utilizing a bouncy ball that you can interact with 📐🎱
- Host: GitHub
- URL: https://github.com/kodesun/bouncy-ball
- Owner: kodesun
- License: mit
- Created: 2024-05-13T08:17:15.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-20T01:42:18.000Z (over 1 year ago)
- Last Synced: 2025-01-16T10:50:26.505Z (over 1 year ago)
- Topics: bouncy-ball, physics-simulation, sfml-game
- Language: C++
- Homepage:
- Size: 1.98 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Bouncy Ball 📐🎱
This simple SFML application simulates real-world physics utilizing a little bouncy ball.
Users can interact with the ball, by clicking it and disabling/enabling the gravity
and damping applied to the ball observe it's realistic behavior as it bounces around the screen.
## Requirements
- SFML Library - Ensure that you have the SFML library installed.
- C++ Compiler
- CMake (or other linking tool)
# Installation
- Make sure to have SFML already installed
- In the project directory run `chmod +x compile.sh` to build and run.
## Features
* **Realistic Physics**: The application incorporates real-world physics principles, mainly gravity and damping.
* **Interactive**: Users can interact with the ball by clicking and dragging it around the screen.
* **Visual Feedback**: Demonstrates the effects of gravity, momentum, collisions, acceleration and velocity.
## Design
Utilized a simple **_OOP_** approach to separate shared data, window functions, collision detection and ball actions.
A cooler example of a **_state machine_** design can be viewed in my [Flappy Bird](https://github.com/sudfish/Flappy-Bird) recreation.
## Demo

## Controls
* `P` to toggle Pause
* `Q` to Quit
* 'D' to toggle Damping
* 'G' to toggle Gravity
* `Mouse` to drag the ball and give it acceleration
---
Feel free to use this however you like.
- [@kodesun](https://github.com/kodesun)