A Python/Pygame game that combines projectile motion physics with a target shooting challenge.
The project started as a projectile motion simulator and later evolved into a game where the player must hit a target using physics calculations.
| Control | Function |
|---|---|
| + Gravity | Increase gravity |
| - Gravity | Decrease gravity |
| + Velocity | Increase launch velocity |
| - Velocity | Decrease launch velocity |
| + Angle | Increase launch angle |
| - Angle | Decrease launch angle |
| Button | Function |
|---|---|
| Start | Fire projectile |
| Restart | Generate a new target |
| Aim Assist | Shows predicted trajectory |
| Target Ring | Points |
|---|---|
| Bullseye | 50 |
| Middle Ring | 30 |
| Outer Ring | 10 |
When Aim Assist is enabled:
| Target Ring | Points |
|---|---|
| Bullseye | 25 |
| Middle Ring | 15 |
| Outer Ring | 5 |
How to run:
-click this link for web version https://madmanmr.github.io/madmanmr-ProjectileMotion-build-web/
-install localy (wouldn't recommend doesn't really work)- https://github.com/madmanmr/ProjectileMotion/releases/download/ProjectileMotionGame/ProjectileCode.zip
x = v₀ cos(θ)ty = v₀ sin(θ)t - ½gt²H = (v₀ sin(θ))² / (2g)R = (v₀² sin(2θ)) / gT = (2v₀ sin(θ)) / g- Revised projectile motion equations.
- Set up the Pygame window and project structure.
- Implemented the core projectile motion calculations.
- Added buttons and variable displays.
- Fixed timing issues so the simulation matched theoretical flight times.
- Added an end screen and restart system.
- Reorganised the code structure.
- Fixed several timing and display bugs.
- Improved variable updates and restart functionality.
- Added a randomly positioned target.
- Added projectile splash effects.
- Implemented collision detection.
- Created a multi-zone scoring system.
- Added an aiming line.
- Added a trajectory prediction parabola.
- Introduced a score penalty when aim assist is enabled.
- Improved the overall UI layout.
- Improved button and screen layouts.
- Added a Game Over screen.
- Added final score display and Play Again button.
- Fixed remaining bugs and completed the project.
- Adjustable launch velocity
- Adjustable launch angle
- Adjustable gravity
- Accurate projectile motion physics
- Random target placement
- Multi-zone scoring system
- Splash effects
- Aim assist trajectory prediction
- Live flight statistics
- Restart functionality
- Game Over screen
- Projectile motion physics
- Pygame development
- Collision detection
- Real-time simulation
- UI design
- Debugging and refactoring
- Moving targets
- Wind resistance
- Multiple levels
- High score system
- Different target types
- Better graphics
- Sound effects
- Power meter
This was my second python project and I really enjoyed making more of a game with it. I found using the basic pygame quite simple as I had previously used pygame. The scale factor to convert pixels to metres and clock to get all the statistics accurate were a struggle. My code layout was an improvement to my last project however, I could make the code much smaller and more efficient. I will try to write a proper plan of my next project on paper before I start coding it to help get the layout right. Overall I really enjoyed making this game and I would recommend making physics simulations in python. Hope you enjoy my game :)