Skip to content

NoaAizer/OOP--The-Maze-Of-Waze

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Maze of Waze

Authors: Noa Aizer & Lior Samuel-Levy

Description:

In this project we used the infrastructure of assignment 2 - Graph.

We have developed a logic for a game where a group of robots has to perform tasks by moving along the graph according to the direction of the side.
Each edge has a weight and a "coin" collection, for each robot we have planned movement so that at the allotted time the total "coin" will be maximum.
The coins are represented by fruits - banana and apple.
That we move from low vertex to high we will collect - apple and if we move from high vertex to low we will collect - banana.

There are 0-23 stages, each with a different amount of robots, fruits and allotted time.
Each fruit collected creates a new fruit at a random location.

When playing the game the user chooses the stage and whether he wants automatic or manual play:

  • Manual management- The client can choose the location of the robots and decide how to move them at each step with the mouse.

  • Automatic management- Our algorithm decide the robots locations and move them toward the fruits in order to achieve as many points as possible.The algorithm finds the nearest fruit with the highest value and moves there- according to the dijkstra algorithm.

In this project we received data from a server (jar file) on which the game is performed.
Obtaining the information was based on strings represented as JSON.

Our Packages & Classes:

In the project we have 8 packages:
Algorithms:

  • Game_algo- This class has several algorithms that are used during the game such as: Location and moving the automatic robot, creating the elements, etc.
  • Graph_Algo- A class with some algorithms can be applied on a DGraph. We used the same class from the previous exercise - (for more information Graph).

Data Structures

  • DGraph- This class representing a grpah with nodes and edges. We used the same class from the previous exercise (Graph), but we add 2 more methods for creating a DGraph from a JSON file and converting to a JSON file.
    (*Node & Edges- Same as the previous exercise.)

Elements:

  • Fruit
  • Robot
  • Arena

GameClient:

  • Ex4_Client- this class IS the "main" method running the whole project. In order to start playing the game you need to run this class.
  • KML_Logger- Converting the game to a KML file.
  • MoveManual- A thread used for moving the robots manually (The manually moving was also conducted in StdDraw class).
  • MyGameGUI- Displaying of the game in JAVA (Using StdDraw).
  • SimpleDB- This class represents a simple example of using MySQL Data-Base.

Tests:
We have created 5 JUNIT test (using JUNIT 5 version).

Utils:

  • StdDraw - We add an option to add the robot manually in this class. Also used for diplaying the game.
    ( *Range & Point3D).

Data:
In this package you will find the KML files and the elemnents images.

Lib:
GameServer_v0.33.jar
java-json.jar
gson-2.8.6.jar
mysql-connector-java-5.1.47.jar

An explanation of the game and an extension of each package in the project can be found at WIKI.

Example of stage 10 in the game:

Game GUI JAVA

An Example:

Game GUI Google Earth

You can also see the graph, robots, and fruits in the KML file.
The KML file can be opened in Google Earth, the view you will receive -
An Example:

Our Best Grades:

An Example:

Enjoy!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages