Codebreaker Game

Overview

Codebreaker is a puzzle game developed in Java that challenges players to guess a randomly generated code made up of seven colours. The game uses Swing to provide the player with a Graphical User Interface (GUI), allowing players to input their guesses for the correct colour sequence within a limited number of attempts. After each guess, the game provides the player with visual feedback to help guide the player towards solving the randomly generated code.

starting Codebreaker board
Example screenshot of the Codebreaker starting board

Technologies Used

Gameplay Mechanics

Code Generation

The code is created when the game is loaded; it is a randomly generated sequence of four colours, selected from seven possible colour options. Each game begins with a unique combination, ensuring a different challenge every time.

Guessing The Code

Players have a set number of attempts to guess the correct colour sequence. After each guess, visual feedback is provided to help guide the player towards the correct combination.

To make the game more difficult, the feedback does not reveal which specific selected colours are correct, only that it has occurred.

Partially completed game board
Example screenshot of the Codebreaker board part way through a game

Completing a Game

The game ends either when the player successfully guesses the code or when the player is unsuccessful and runs out of attempts.

A successfully completed game
Example screenshot of a successful game

An unsuccessfully completed game
Example screenshot of an unsuccessful game

Conclusion

Developing the Codebreaker game application, during my first year at Lancaster University, provided me with valuable experience in writing Java programs and creating a Graphical User Interface (GUI) using Swing. This project allowed me to deepen my knowledge of object oriented programming principles while also exploring the complexities of GUI development. This project served as a solid foundation for developing interactive applications and highlights some of my early skills in coding and design.