Asteroids Game is a simple JavaFX-based game where you control a spaceship to destroy asteroids and earn points. Your goal is to survive as long as possible while accumulating points by shooting asteroids. Be careful not to collide with the asteroids!
To play the Asteroids Game, follow these steps:
-
Clone this repository to your local machine.
$ git clone https://github.com/ken1009us/asteroid.git
-
Open the project in your Java development environment (e.g., IntelliJ IDEA, Eclipse).
-
Compile and Run:
Navigate to the project directory and compile the application using the following command:
$ javac com/asteroids/AsteroidsApplication.java
Run the application with:
$ java com.asteroids.AsteroidsApplication
- Use the Arrow Keys to control the spaceship:
- Left Arrow: Rotate the spaceship counterclockwise.
- Right Arrow: Rotate the spaceship clockwise.
- Up Arrow: Accelerate the spaceship.
- Press the Spacebar to fire projectiles at the asteroids.
- Your spaceship starts at the center of the game window.
- Asteroids will appear randomly on the screen.
- Rotate your spaceship to dodge asteroids and shoot them down with projectiles.
- Each destroyed asteroid earns you points.
- The game continues until your spaceship collides with an asteroid.
- Avoid colliding with asteroids to stay alive.
- You can shoot projectiles to destroy asteroids and earn points.
- The game ends when your spaceship collides with an asteroid.
- Try to achieve the highest score possible by destroying as many asteroids as you can.
