Skip to content

Latest commit

 

History

History
45 lines (29 loc) · 2.09 KB

README.md

File metadata and controls

45 lines (29 loc) · 2.09 KB

Projectile Launcher - Java Swing GUI

This is a Java Swing GUI application that simulates a projectile launcher. Users can interact with the GUI to launch a projectile and observe its trajectory under different conditions. The application allows users to adjust the weight of the projectile and randomizes the planet's gravity to add an element of challenge and fun.

Features

  • Launch projectiles with varying weights and observe their trajectories.
  • Randomize the planet's gravity to simulate different planetary conditions (Earth, Moon, Mars, Jupiter).
  • Display wind resistance that affects the projectile's path.
  • Basic graphical representation of the launcher and projectile trajectory.

Getting Started

To run the project, follow these steps:

  1. Clone the repository to your local machine.
  2. Open the project in your Java IDE.
  3. Compile and run the Frame.java file.

How to Use

  1. Upon running the application, a GUI window will open, showing a cannon-like launcher at the bottom of the screen.
  2. Adjust the weight of the projectile using the weight slider at the top of the window.
  3. Click and hold the left mouse button to aim the projectile. The aim is indicated by a small intersection point on the screen.
  4. Release the mouse button to shoot the projectile.
  5. The projectile's trajectory will be displayed on the screen, and you can observe how the projectile moves under the influence of gravity and wind resistance.
  6. After the projectile hits the ground, you can shoot again by clicking and holding the mouse button to aim.

Notes

  • The projectile's trajectory is affected by air resistance, which is randomized every two shots.
  • The planet's gravity is also randomized (Earth, Moon, Mars, or Jupiter) for each session.
  • The graphics are basic and can be improved to enhance the user experience.

Dependencies

This project uses Java's Swing library for creating the graphical user interface.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Created by lab596 - Feel free to contact me!