Simple project built with the MonoGame framework. It demonstrates core game loop concepts, collision detection, and user input handling by allowing the player to dynamically create and destroy bouncing squares within the game window.
- Dynamic Object Creation: Left-click the mouse anywhere on the screen to instantly spawn a new square that begins moving.
- Boundary Collision: Each square bounces realistically off all four edges of the game window.
- Frame-Rate Independent Movement: Object movement and updates are tied to game time, ensuring smooth, consistent behavior regardless of the system's current frame rate.
- Scalable Display: The game is fully scalable, adjusting to different window sizes while maintaining the correct aspect ratio and ensuring the squares' positions and sizes scale appropriately.
- Customizable Aesthetics: Users can easily change the background color of the game window.
- Screen Clearing: Right-click mouse to clear all squares.
- C#
- MonoGame Framework
- Vector math
Demo.mp4
- If not already done, install .NET SDK from official Microsoft website
Note
The .NET version of this project is 9.0
but if you have an older version, you can manually change the project's version by going in all the .csproj files as well as the .sln file to change 9.0 to which version you have installed.
- Install MonoGame Templates
dotnet new install MonoGame.Templates.CSharp
- Clone project
git clone https://github.com/MelaniaChiru/Bouncing-Ball-Game.git
- Go to 'BouncingBallGame' folder. (BouncingBallGame.csproj should be inside)
cd BouncingBallGame - Run game
dotnet run
- Introcude square to square collision (i.e. have squares bounce off each other).
- Add different shapes (circles, triangles, rectangles, etc.)