This is a space game created using Java, mainly using the java.awt and java.swing libraries. In this game, the player controls an alien that moves around in the game window. The objective is to dodge the randomly generated asteroids to survive as long as possible. The game ends when a collision between the alien and asteroid is detected.
To run the game, you will need to have Java 8 or higher installed on your computer.
- Download the source code from the repository and cd to Cosmic-Dodge/src
- Compile the code using
javac CosmicDodge.java
- Run the game using
java CosmicDodge
OR
You can just download the Cosmic-Dodge.jar executable jar file and run it.
- Use the arrow keys to control the movement of the alien.
- Dodge the randomly generated asteroids to avoid collision.
- The game ends when a collision is detected between the alien and an asteroid.
You can also play this game on Replit without having to clone the repository or downloading the jar file. Just follow this link : Cosmic-Dodge. (Just make sure to go full-screen before you run the repl). Do like the repl if you liked the game! 😉
Contributions to the game are welcome. If you find a bug, have a suggestion or an improvement, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License.