https://github.com/ir404/space-invaders
A JavaFX program to play Space Invaders.
https://github.com/ir404/space-invaders
desktop-application game javafx javafx-application javafx-desktop-apps spaceinvaders
Last synced: 6 months ago
JSON representation
A JavaFX program to play Space Invaders.
- Host: GitHub
- URL: https://github.com/ir404/space-invaders
- Owner: ir404
- License: apache-2.0
- Created: 2021-05-30T10:13:53.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-06-11T22:35:40.000Z (6 months ago)
- Last Synced: 2025-06-11T23:28:38.611Z (6 months ago)
- Topics: desktop-application, game, javafx, javafx-application, javafx-desktop-apps, spaceinvaders
- Language: Java
- Homepage:
- Size: 312 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Space-Invaders
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

## Playing the Game
1. Download and set up a JDK (version 17+)
1. If you're on Windows, it's a good idea to add it to your PATH environmental variable
2. Download JavaFX 21 SDK according to your OS ([link](https://gluonhq.com/products/javafx/))
1. Take note of path to the `/lib` directory. For example: `C:\Program Files\Java\JavaFX\javafx-sdk-21.0.7\lib`
3. Clone this repository
4. Open the project directory in the terminal/command prompt
5. Run the following command to compile the project:
1. `javac --module-path "C:\Program Files\Java\JavaFX\javafx-sdk-21.0.7\lib" --add-modules javafx.controls,javafx.graphics Game.java`
6. Next, enter the following to run the program:
1. `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`
7. Use the arrow keys to control your player, space to shoot and escape to pause/resume the game
8. FYI, the movement of your spaceship may not be very smooth but hey, its playable :)
9. Enjoy