GameGUI - rotemish7/OOP_Ex3-4 GitHub Wiki
This class is responsible on the visual part of the game.
All of the objects we need for the creation of the GUI we get from the game_service.
From the server we get:
- the graph - all the nodes and edges.
- the fruits and their location.
- the amount of robots and their location.
- the grade
- the amount of moves made.
- First creation of the game:
We initalize the game GUI according to the graph we get from the server, then we adding the fruits by their location and after depands on the type of the game(Manual or Auto) we are adding the robots to the gameGUI.
During the game:
We used doubleBuffering in this project to enable the graph to be painted one time , while other components such as: fruits and robots beenn painting again and again depend on their location.
We also added the game information on the screen so the user can keep track of is:
- score
- time to play
- moves made by the robots
- the actual move of the robots during the game