Skip to content

LeviEyal/Pokemon-Catcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

95 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

head

OOP EX2 - Pokemon Catcher:

This is the third assignment in the course opject oriented programming, ariel univerisy. The project is about implementing a directed weithted graph and exploring some graph algorithms. In the game we place several agent on a graph and their goal is to earn points by catching the random pokemons. Each pokemon has its value.
For more information, visit the project's wiki tab.

made by:

Eyal Levi - GitHub page: github.com/LeviEyal
Moti Dahari - GitHub page: github.com/motidahari

How to use?

clone the project to your computer and run the file Ex2.jar by the command:
java -jar Ex2
on the same folder as Ex2.jar is on.
the main window of the game will sow up:
enter image description here
Enter your ID and select the level you will to play and click the "play!" button.

Another way to login to the game is by the command:
java -jar Ex2.jar 123456789 7
where 123456789 is your id and 7 is the level you want to play.

The package api

This package contains all the implementation of the graph.
it represent the graph as adjacency list using hash maps.
The class DWGraph_DS - Represent the graph implemented as adejency list.
The class DWGraph_Algo - Contaions several algorithms that can be operate on a given graph.
The class EdgeData - Represnts an edge in a graph.
The class NodeData - Represnts a node in a graph.
The class EdgeLocation - Represnts an edge's location in a graph.
The class GeoLocation - Represnts a 3d location.

The package files list:

img
package diagram:
enter image description here

The package gameClient

The class Agent - a pokemon catcher. it has the following properties: position, id, speed, current edge, current pokemon, value.

The class Pokemon - Every pokemon has the following properties: edge (on which the pokemon on), value, type (if the type is -1 so the pokemon lies in a slope), position (3d point), minimum distance (every agent set this to mark the distances to all pokemons), from (the node on this pokemon's edge that "behind" the pokemon), to (the node on this pokemon's edge that "in front" of the pokemon), worth (based on the minimum distance + value)

The class Arena - represents a multi Agents Arena which move on a graph grabs Pokemons and earn points. This is where all the game is happening: the communication with the server, the agent and pokemons updating, the algorithms performs to manipulate the agents. etc.

The class Ex2 - This is the engine class of the game.

img

The package GUI

The class MyFrame - This class represents the main window of the game

The class MyPanel - This class represents the main panel containing the game

The class ComponentResizer - allows to resize a component by dragging a border of the component.

img

Screeenshots

enter image description here enter image description here

Algorithms used:

some variations of the BFS algorithm and dijkstra algorithms.

External info

What is graph: https://en.wikipedia.org/wiki/Graph_(discrete_mathematics)

Connectivity of a graph: https://en.wikipedia.org/wiki/Connectivity_(graph_theory)

The shortest path problem: https://en.wikipedia.org/wiki/Shortest_path_problem

The BFS algorithm: https://en.wikipedia.org/wiki/Breadth-first_search

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages