“SwingCross” is a small game that I programmed in Java in early summer 2020, shortly after learning the basics of object-oriented programming as part of my Media Informatics studies. After each participant of the programming course I took had previously been tasked with creating a Minesweeper clone in Java, the next assignment was to develop any game of choice. I decided to build a clone of the famous puzzle game “Picross” and expand it with several features. The game is built upon Java’s GUI toolkit “Swing”, which inspired the game’s name.
A Picross, also known as a nonogram, is a grid-based picture puzzle invented by Japanese designer Non Ishida in 1986. It gained widespread popularity through various video game adaptions by Nintendo. The game is fairly simple: Each picross consists of a pixel grid and the goal is to figure out which pixels should be colored and which not. Each row and column has got numbers that provide a clue on which pixels should be colored. For example, if a row is provided with the number 5, a set of five adjacent pixels have to be colored in that row. If a row is provided with the numbers 2 1 3, two adjacent pixels have to be colored, then a single pixel, and then three adjacent pixels. In essence, the game is a mixture of “Paint-by-Numbers” and “Sudoku”.
How to solve a Picross
Schritt 1: This picross has a grid of 5×5 pixels—all rows marked with a 5 can therefore straight up be colored completely.
Schritt 2: The row in-between may also be filled out: 3 single pixels, separated by gaps explains the entire row.
Schritt 3: At the same time, the first and last column are solved. Therefore the remaining pixels may be crossed out (using right-click).
Schritt 4: This gives us enough clues to solve the second row: 2 single pixels, separated by a gap.
Schritt 5: All that’s left is a single pixel in the upper row. Since columns 2 and 4 have already been cleared, it has to go in the middle column.
Schritt 6: And done! The solved picross shows a house.
SwingCross offers 6 different levels as well as a random level generator. Furthermore, the game offers to show a hint when players are stuck or have made a mistake. Finally, the game allows you to create your own patterns and export them as files to later load them up and replay them.
Java meets Yahtzee
As a programming beginner, I had a lot of fun developing SwingCross. I wanted to challenge myself a little more and decided shortly after to develop another game in Java: a clone of the famous dice game “Yahtzee”, which I appropriately named “Javatzee”! Okay, the name might not win an award for creativity anytime soon…
Every beginning is difficult
Yes, Swing was already outdated in 2020. Yes, nobody would seriously develop small games like this as Java desktop applications today—these are much better suited as web or mobile apps. And no, I’m probably not going to win a Game of the Year award with them. ;) Still, I’m proud of SwingCross and Javatzee, as these small projects represent my first steps into the world of application development.
Both games are available here as .jar files for download (Java is required to run them).