Game Content Summary
The users control the character via the keyboard. The aim is to collect items to points, and the game is over when the time is over or reaching the target scores.
Main Functions of The Program
(User Manual)
-
The users use the UP, DOWN, LEFT and RIGHT arrow keys to control the character’s movement.
-
The character cannot move through when touching the wall.
-
The character can collect coins and hearts in the maze when meeting them.
-
Different items have different functions in the game. A coin is worth 20 points while a heart adds 50 points.
-
The character needs to avoid bombs. Otherwise, 50 points will be deducted.
-
A time restriction is added to make the game look more challenging. The users must complete the goal within a specified time to win the game.
-
The UI element has been added to make the game more complete.
-
Users will enter round two after winning the first round. The maze will be more complex to attach challenge to the game.
-
Sound effects are added to the events in the game, such as collecting objects and encountering bombs, to make the game more interesting and give the users feedback.
-
Win and lose pages are used to give users feedback and enhance the interaction between the user and the system.
Technical
Game System (Loop) Logical Design

In the process of interface design, it always adheres to the principle of clarity. As for performance, it can achieve the advantages of high efficiency, not easy to make mistakes, etc.
Module Planning
Framework of functional modules
According to the functions that the game needs to achieve, the entire game is divided into two modules for a specific design.

The main game interface module
GUI elements: Create a column on the left side of the main interface and add the display of rounds, scores, and remaining time to this column to add visual effects.

The game control module
Users interact with the system through mouse clicks and a keyboard.

This module mainly controls the beginning of the game through a mouse click while the arrow keys are used to control movement, thus affecting the game scores. In this module, I write code for each event to further implement for the above functions.
The main program structure

Core Algorithm Analysis
drawMaze()
-
Draw maze maps
-
Basic idea: Use a two-dimensional array to store data in a CSV file to draw a maze map.

moveUp(), moveRight(), moveDown(), moveLeft()
-
The users press the keys to interact with the character to control the movement. When encountering obstacles, the character reacts accordingly, such as not being able to move through the wall.
-
Basic idea: Use the for loop and if conditional statements to compare the character's coordinates with the range of the obstacles. If it is in the ranges, use the boolean variable to prevent the character from moving through.

The Detailed Flow Chart of Character’s Movement

Program Running Results








Self-evaluation and Future Development
Problem exploration and expansion analysis
The problems encountered in the process of designing the program are as follows:
1) The judgment of the system is not very accurate when the character meets hearts and bombs because of the irregular shape of hearts and bombs. When I need to implement similar functionality in the future, I will try to write code using other methods.
2) Due to the DPI of different systems not taken into account at first, the full screen is selected in the size of the canvas, resulting in the game content display not centered on some monitors. Setting the canvas size to 1920 by 1080 later solved this problem. However, it affected the visual effect to some extent.
Future development
Extension analysis:
1) Before starting the design, in order to get a better visual experience, I will consider the DPI and various factors before confirming the canvas size.
2) There are also some functions that I want to achieve but haven't done yet, such as the design of portals. I will use the same method as when encountering a wall, except that the return content is altered into a change in the character’s coordinates.
3) To better realize my preconceived ideas in the game, I will keep reading and modifying the code while comparing the drawn flow charts and functional modules, so that the program can achieve the desired goal.
