This is a side-scroller style space-shooter minigame created on Greenfoot. For those unfamiliar with Greenfoot, it’s “a visual and interactive program that uses object orientation with Java to build games, simulations, and other graphical programs”. I created this project to use as a demo for a course I taught, as well as brush up on my own knowledge. To play, head to Here’s the GitHub repo with my code:

Game Mechanics

The user is tasked with navigating through an asteroid field and racking up a high score. The player can move the spaceship using either the arrow keys or WASD, as well as fire lasers by pressing the spacebar. In the game’s current form, the player must survive for 1800 ticks (~35 seconds) to survive. The asteroid spawn frequency increases as the game progresses, along with the speed of the asteroids. If the player’s spaceship hits an asteroid, the game starts over. The player gains 100 score each time they successfully disintegrate an asteroid.

Final Thoughts

This minigame served its purpose well and is therefore complete, although there is certainly a lot of room for expansion. Things that I wanted to implement but didn’t get the chance to are: a lives system, hostile spaceships, multiple levels, and bosses with giant health bars. Overall though, this project was a lot of fun and a good way for me to practice Java.