Groovy Invaders

Back in April 2023, I got a job offer from another department in the company I worked at. One of the things that was on the job description was that the systems that they used for automation and scheduling were based off of Groovy. Groovy is a Java-based language that allows for a more script-ish approach rather than the strict Object-orientation of Java. Since I didn’t know Groovy, I decided to make Groovy Invaders as a way of learning the language in the downtime I had during my notice period.

I unfortunately didn’t manage to package it in an executable Jar file (I worked on it for several days), so you’ll have to recompile it yourself. Simply download the repository from the Groovy Invaders Gitlab page and run gradlew run and it should compile and run after a minute or two. You need to have the JVM installed on your machine prior to trying this.

Playing the game

Groovy Invaders plays just like any Space Invaders clone, with a couple of differences.

First, there is no shoot button. The player character just shoots a bullet automatically every second, without pause.

There is only one enemy drop which is the Groovy Logo. Catch it, and after a “groovy” line, you’ll shoot out a shotgun shot.

The difficulty scales as the level progresses. The enemies start to move faster and shoot more frequently. Each new level also increases the count of enemies by one row and one column for a total of five levels.

An alien voice taunts you at the beginning of every level with increasing desperation as you kill off all his invading ships.

The final level introduces a powerful beam that shoots down instantly after a few seconds and lingers on for a few more.

That’s all there is to it, really.

Groovy Invaders development

While making Groovy Invaders, I tried to make it without any IDE like IntelliJ or Eclipse. Instead, I opted for making everything text-only and using Gradle/JDK to take care of things. This is mostly because I like to keep things light and felt like I was getting a better grasp on the system if I did it this way. Also, the software we use at my new job doesn’t use any of these IDEs.

To do pretty much all the work, I used a library called JavaFX. This controlled the showing of graphics, the audio, the input and the timing. It’s also the reason why I couldn’t make an executable, since I couldn’t figure out a way of including it in the JAR correctly.

The work I did was all contained in one large ‘game’ object so I didn’t really take advantage of Groovy’s OOT nature. Every character, bullet and background is an ImageView, and that’s all the game needs.

This is also the first time I used ChatGPT to help with development. I only used it as a way of summarising documentation since I don’t really feel comfortable copying large chunks of code that I didn’t write (same with Stack Overflow) unless it a library or something.

The backgrounds and sounds were taken from online, but the sprite images were fun to draw up. I tried to make the enemies increasingly-menacing as the player progresses through the levels.

Overall it was a fun experience and not to difficult to work with, except of course getting the thing compiled and packaged.


Subscribe to the mailing list

Follow N64 Squid

  • RSS Feed
  • YouTube

Random featured posts