A recreation of the infamous arcade game - Space Invaders!
By building this project I learnt a little about
- pixel art (yes, the spaceship image and alien ships were designed by me)
- box collision
- Download and set up a JDK (version 17+)
- If you're on Windows, it's a good idea to add it to your PATH environmental variable
- Download JavaFX 21 SDK according to your OS (link)
- Take note of path to the
/lib
directory. For example:C:\Program Files\Java\JavaFX\javafx-sdk-21.0.7\lib
- Take note of path to the
- Clone this repository
- Open the project directory in the terminal/command prompt
- Run the following command to compile the project:
javac --module-path "C:\Program Files\Java\JavaFX\javafx-sdk-21.0.7\lib" --add-modules javafx.controls,javafx.graphics Game.java
- Next, enter the following to run the program:
java --module-path "C:\Program Files\Java\JavaFX\javafx-sdk-21.0.7\lib" --add-modules javafx.controls,javafx.graphics --enable-native-access=javafx.graphics Game
- Use the arrow keys to control your player, space to shoot and escape to pause/resume the game
- FYI, the movement of your spaceship may not be very smooth but hey, its playable :)
- Enjoy