-
Notifications
You must be signed in to change notification settings - Fork 1
Classes
Ofek Rotem edited this page Jan 8, 2022
·
2 revisions
Explanations about these classes can be find in this README from our previous task.
- DiGraph
- GraphAlgo
- GraphAlgoInterface
- GraphInterface
Our way of connection to the server. Sends and recieves json str to and from the server.
Basic class to make usage of images during the game easier. Once initialized, it loads all relavent images and stores them in dictionaries.
This is the main script that runs the game. it includes the following functions:
- scale(data, min_screen, max_screen, min_data, max_data) - get the scaled data with proportions min_data, max_data relative to min and max screen dimentions.
- my_scale(data,x,y) - scales eiter x or y.
- get_edge(pok_x: float, pok_y: float, t: int) - Recieves the pokemons location (x,y) and finds what edge the pokemon is on.
- find_far_pok(pK: dict) - Used for deciding where to place the agents at the begining of the game, finds the pokemon that is the farthest from all agents currently in the game and returns the src node of the edge that pokemon is on.
- draw_button(button,screen) - Draws the given button on given screen.
- create_button(x, y, w, h, text, callback): Create button that when pressed calls the function callback().
- stop_Game() - Displays picture , closes server and closes GUI.
The main file to run this project. It runs the script in student_code.py from given level or if no level is given starts game to level 11 by default.