This project is a simple animation of bouncing balls on an HTML canvas. The balls respond to gravity, collisions with the canvas edges, and collisions with each other. Clicking on the canvas adds new balls, and right-clicking removes balls. The project also includes basic audio feedback for collisions and can be paused and resumed with buttons.
- Balls respond to gravity and bounce off the edges of the canvas.
- Balls detect and respond to collisions with each other.
- Click to add new balls with random properties (size, color, velocity).
- Right-click to remove balls at the click location.
- Pause and resume the animation using buttons.
- Background color changes dynamically over time.
- A modern web browser with JavaScript enabled
- Typescipt compiler
- Clone the repository:
git clone [email protected]:Yerish26/BouncingBalls.git cd bouncing-balls
- Open the project in Visual Studio Code (VS Code).
- Compile the TypeScript using the
tsc
command in Git Bash. - Open
index.html
with Live Server. - Left-click on the canvas to add a new ball.
- Right-click on a ball to remove it.
- Click the "Pause" button to pause the animation.
- Click the "Resume" button to resume the animation.