This project consists of a player client and a server that communicate to simulate a game environment. The player client can be controlled via keyboard inputs or automated logic, and the server manages the game state and communication between multiple players.
The project is organized into two main components:
The player client is implemented in the player directory. The main components are:
player.py: Contains thePlayerclass,PlayerDataClientclass for server communication, andKeyListenerclass for handling keyboard inputs.player_logic.py: Contains theplayer_logicfunction that processes game state and updates the player's actions and velocity.
Check Player README to see how to implement the player logic
- Ensure the server is running.
- Run the player client:
python player/player.py
The server is implemented in the server directory. The main components are:
manager.py: Contains theManagerclass that handles the game state and communication with players.serial_interface.py: Contains theSerialInterfaceclass for handling serial communication.socket_server.py: Contains theSocketInterfaceandSocketClientclasses for handling socket communication with players.
- Run the server:
python server/manager.py
The player client communicates with the server using socket communication. The server processes the player's data and sends back the game state.
- Python 3.x
pynputfor keyboard handling (install usingpip install pynput)pyserialfor serial communication (install usingpip install pyserial)