GithubHelp home page GithubHelp logo

pokemon-game's Introduction

Pokemon Game

Description

  • First part:
    deals with the construction of directional weighted graphstarting from the creation of the nodes and edges in the graph,
    continues with the creation of the graph itself (such as connecting the nodes in the graph and more) and basic algorithms related to the graph (paths in the parent link graph and more). A graph is made up of four interfaces arranged according to the hierarchy from the creation of a node to the execution of an algorithm on the graph.
  • Second part:
    Engaged in creating the Pokemon game from building the game itself graphics, actions performed in the game, placing the agents and building a victory strategy.

First part:

is made up of 4 classes
NodeData class: This implements node_data node in a graph consists of a
info, tag, location and weight. In this class you can perform operations on a node in a graph such as a constructor and get and set operations on the node fields.

DWGraph_DS class:
This implementation directed_weighted_graph
A graph is made up of a
Vertices, Neighbors, countMC and edgeSize.
In this class there are several functions that can be done in the graph such as:
constructor, add node, delete node and edge, make a connection between 2 nodes, get a collection of all the node and neighbors and more.
And operations that can be performed in edge: constructor and get and set operations to edge fields that are src, des, weight, info, tag.

Graph_Algo class:
This implementation dw_graph_algorithms
This class represents a number of algorithms that can be made on a graph
Main functions: isConnected- checks whether the graph is linked.
shortestPathDist- Returns the length of the shortest path.
shortestPath- Returns a list of nodes in the shortest path.
The class methods use 2 main algorithms Dijkstra and BFS

Point3D class:
This implementation geo_location
that represents a geo location <x,y,z>.
In this class the number of functions that can be performed in a location.

Data Structure:
HashMap-It is used because it allows you to get data based on key in O(1).
ArrayList-Because it has the ability to create a list in the desired order.
PriorityQueue-Because it has the ability to adjust the position of the object by definition.

Second part: Pokemon game

is made up of 8 classes

Agent class:
Class representing an agent in a graph for each agent Multiple fields:.
EPS, Count, _Seed, _Hand, _Pos, _Speed, _Sedge_Course, _Shoot_Course, _gg ,_Fruit_Course, _Sg_DT,.
This class advises a number of actions that can be performed on an agent such as:.
builds, get and set actions for the class fields,
Main functions: setNectNode- Defines the next node for the agent.
getNextNode- Returns the node to which the agent is intended
And more.

Arena class:
This class represents the data of each stage of the game
Allows you to get and configure data for the game
The class is made up of the fields: EPS1, _gg, _agents, _pokemons, _info, timer, MIN, MAX.
In this class you can perform a number of operations on the game such as: get and set operations for the class variables, getAgent- Returns the agents that belong to the phase. json2Pokemons- Gets a string of Pokemon and returns a list containing them. updateEdge- Updates the locations of Pokemon to edges.
and more.

Ex2 class:
In this class the main is defined through which the game can be run.

GameFrame class:
This class represents a GUI class to present game on a graph.
which contains features of the game window and the creation of a panel for drawing components on the frame window.

GamePanel class:
The GamePanel class is used for drawing the components on the frame of the game
Contains: drawing information about the game, graph, Pokemon, agents, and refreshing
the components each time.
Class variables: _ ar, _w2f.

LoginGameFrame class:
This class defines the game login window using the following functions:
LoginGameFrame- A method that defines the graphical parts of the login window such as type, button text box and more.
windowCenter - places the login screen in the middle of the screen.

MainGame class:
The department where the game takes place,
Department fields: _win, _ar, scenario_num, id, dt.
The game is run using the following functions:
Main functions: moveAgents- A function in which the move is made to each agent and a route is assigned to the agent.
strategy2- victory strategy was built in the department: MainGame Which uses the shortestPath function - which returns a list of nodes of the shortest route (defined in the DWGraph_Algo class). This is how the shortest route to each Pokemon in the game to which the agent is sent is calculated. When a situation arises where an agent in a game is stuck at the edge we will make a low break and a high number of moves so that he can eat the Pokmon and advance to the next edge.

Pokemon class:
This class defines pokemon
Class fields: _edge, _value, _type, _pos, min_dist, min_ro, id.
In this class you can do various actions on Pokemon such as: get and set actions for the class variables, builder, and more.

Goal of the game: Collect as many Pokemon as possible.
The more Pokemon you collect with the help of the agents, the higher the score, depending on the specific value of the Pokemon. In order to reach the maximum score, a victory strategy was built in the department: MainGame Which uses the shortestPath function - which returns a list of nodes of the shortest route (defined in the DWGraph_Algo class). This is how the shortest route to each Pokemon in the game to which the agent is sent is calculated. When a situation arises where an agent in a game is stuck at the edge we will make a low break and a high number of moves so that he can eat the Pokmon and advance to the next edge.

For more information on the game visit Wiki

Login Page Game Page

Screen Shot 2023-01-06 at 11 00 23

Screen Shot 2023-01-06 at 11 00 43

The game can be played from:

Authors @Shilo Elimelech @Lior Atiya

pokemon-game's People

Contributors

shiloeli avatar lioratiya avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.