ICT221 Java: Implementation of a Single-Player Puzzle Game with GUI
VerifiedAdded on 2023/03/30
|5
|753
|285
Project
AI Summary
This project presents a single-player 2D puzzle game developed in Java using JavaFX. The game involves moving an empty box to other boxes, avoiding obstacles on a two-dimensional board. The implementation utilizes object-oriented principles, including abstraction, encapsulation, and polymorphism. The game features multiple levels with increasing difficulty, achieved by varying the number and placement of obstacles. A* Algorithm is used for the game's logical design, providing a clear path from start to finish. Additional features include a path help button, obstacle removal functionality controlled by the player, and a step view radio button for user guidance. Future enhancements would involve a different navigation system using frames and panels for efficient level switching.

GAME PROGRAMMING IN JAVA
Student Name
College
Student Name
College
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

Introduction
This is a puzzle game that can only be played by one player at a time, it does not support multiple
players. A player interacting with the game has the ability to move a given empty box to existing
boxes in the game with no interference of boxes containing obstacles. This is possible because
the game has two dimensions board. Development of the game was done in javafx development
language, an object-based language. The development was done using a special java
development environment i.e. IntelliJ IDE .(Anon, n.d.).
A player can only win a game if and only if he is able to shift the position of an empty box
through all empty boxes. A player is able to do this by shifting from a box to another past all
objects along the route. Once a player completes a level(wins a game), he’s granted the ability to
proceed to another level with a complex structure than the preceding level. This is made possible
by the multilevel function that has been included in the game. As one moves from a level to
another , he/she is faced with more obstacles. As mentioned earlier the game is developed in
java, an object-oriented language and thus the game implements abstraction, encapsulation,
polymorphism, overriding and overloading and all other aspects of object-oriented programming.
(Anon, n.d.).
The game is well designed and implements a start and endpoint concept. This is visible in the
game as a player is directed on how to begin the game and where to stop or end it.at the left
topmost corner is the start position of the game while the right bottom corner marks the end point
of a game.
The player is able to set the game according to his level of experience. This can be done by
his/her ability to take charge and alter the number and position of obstacles in a puzzle(Anon,
n.d.).
A path help button is present in the game. It has a button; allow path that provides amateurs with
a possible route to a solution to the puzzle. Another button; show path gives a view of all the
routes a player can take to arrive to a solution very easily.
A user is given a quick guide on how to play the game by pressing the step view radio button.
This is a puzzle game that can only be played by one player at a time, it does not support multiple
players. A player interacting with the game has the ability to move a given empty box to existing
boxes in the game with no interference of boxes containing obstacles. This is possible because
the game has two dimensions board. Development of the game was done in javafx development
language, an object-based language. The development was done using a special java
development environment i.e. IntelliJ IDE .(Anon, n.d.).
A player can only win a game if and only if he is able to shift the position of an empty box
through all empty boxes. A player is able to do this by shifting from a box to another past all
objects along the route. Once a player completes a level(wins a game), he’s granted the ability to
proceed to another level with a complex structure than the preceding level. This is made possible
by the multilevel function that has been included in the game. As one moves from a level to
another , he/she is faced with more obstacles. As mentioned earlier the game is developed in
java, an object-oriented language and thus the game implements abstraction, encapsulation,
polymorphism, overriding and overloading and all other aspects of object-oriented programming.
(Anon, n.d.).
The game is well designed and implements a start and endpoint concept. This is visible in the
game as a player is directed on how to begin the game and where to stop or end it.at the left
topmost corner is the start position of the game while the right bottom corner marks the end point
of a game.
The player is able to set the game according to his level of experience. This can be done by
his/her ability to take charge and alter the number and position of obstacles in a puzzle(Anon,
n.d.).
A path help button is present in the game. It has a button; allow path that provides amateurs with
a possible route to a solution to the puzzle. Another button; show path gives a view of all the
routes a player can take to arrive to a solution very easily.
A user is given a quick guide on how to play the game by pressing the step view radio button.

UML Diagram
GUI Sketches
GUI Sketches
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

Reflection
The sketch depicts the game flow. However , making the games functional requirements merge
and correspond to the sketch was a difficult task. During development, the user obstacle removal
functionality was an important feature that was included. The feature gives the player control
over how many obstacles should be present in a game. Additionally, I was able to implement a
multilevel feature with an increasing number of obstacles in each preceding level creating a
tougher puzzle. The games functionality is purely based on cells and grids that were easy to come
up with. Each puzzle has diagonals easily and perfectly done. Each cell has diagonals that make it
easy for a player to uniquely point out a value associated with various cells in a game.an
additional functionality is the show path, that was well presented to give a view of all the routes
a player can take to arrive to a solution very easily. The logical design and implementation of the
game was done using an A* Algorithm, that gives a clear picture of the game from the start to the
end.
I faced a hard time trying to implement of other features such as the inclusion of several levels’
functionality. This proved to be difficult and hence I opted for creating different number and
layout of obstacles to provide a multilevel functionality. This functionality is purely controlled
by the player as he/she can add or reduce the quantity of obstacles in a game which makes the
game either easy or harder.
In the future if allowed to better the game, I would provide a different navigation system in the
game. I would make use of different frames panels to provide an efficient way of switching
from a level to another with ease. I believe this would make the game more interesting and
commercially acceptable.
The sketch depicts the game flow. However , making the games functional requirements merge
and correspond to the sketch was a difficult task. During development, the user obstacle removal
functionality was an important feature that was included. The feature gives the player control
over how many obstacles should be present in a game. Additionally, I was able to implement a
multilevel feature with an increasing number of obstacles in each preceding level creating a
tougher puzzle. The games functionality is purely based on cells and grids that were easy to come
up with. Each puzzle has diagonals easily and perfectly done. Each cell has diagonals that make it
easy for a player to uniquely point out a value associated with various cells in a game.an
additional functionality is the show path, that was well presented to give a view of all the routes
a player can take to arrive to a solution very easily. The logical design and implementation of the
game was done using an A* Algorithm, that gives a clear picture of the game from the start to the
end.
I faced a hard time trying to implement of other features such as the inclusion of several levels’
functionality. This proved to be difficult and hence I opted for creating different number and
layout of obstacles to provide a multilevel functionality. This functionality is purely controlled
by the player as he/she can add or reduce the quantity of obstacles in a game which makes the
game either easy or harder.
In the future if allowed to better the game, I would provide a different navigation system in the
game. I would make use of different frames panels to provide an efficient way of switching
from a level to another with ease. I believe this would make the game more interesting and
commercially acceptable.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

References
Anon, (n.d.). Java Tutorial: Learn Java Basics For Free | Codecademy. [online] Available at:
https://www.codecademy.com/learn/learn-java/ [Accessed 2019].
Anon, (n.d.). Learn Java (Introduction and Tutorials to Java Programming). [online] Available
at: https://www.programiz.com/java-programming [Accessed 2019].
Anon, (n.d.). New to Java Programming Center - oracle.com. [online] Available at:
https://www.oracle.com/technetwork/topics/newtojava/overview/index.html [Accessed 2019].
Anon, (n.d.). Java Tutorial: Learn Java Basics For Free | Codecademy. [online] Available at:
https://www.codecademy.com/learn/learn-java/ [Accessed 2019].
Anon, (n.d.). Learn Java (Introduction and Tutorials to Java Programming). [online] Available
at: https://www.programiz.com/java-programming [Accessed 2019].
Anon, (n.d.). New to Java Programming Center - oracle.com. [online] Available at:
https://www.oracle.com/technetwork/topics/newtojava/overview/index.html [Accessed 2019].
1 out of 5
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.