A small project to discover online multiplayer games.
- Improve the UDP connection (see issue #47).
- Add better graphics, such as a manor environment and ghosts and hunters skins for players.
- Launch the game on the ISCSC remote server (see issue #48).
Here is how it looks like:
- pygame
- shapely
python3 server.py
or make server
python3 client.py <Server_IP> <Server_Port>
or make client SERVER=<Server_IP> PORT=<Server_Port>
- sends
CONNECT <Username> END
and receivesCONNECTED <Username> <Screen_Size> WALLS <Walls_List> STATE <Players_List> END
as a connection confirmation and to setup the state of the game locally.
- sends
INPUT <Username> <Input> END
and receivesSTATE <Players_List> END
to update the state of the game on the server, and then locally.<Input>
can beLEFT
,RIGHT
,UP
,DOWN
for movements ;RED
,BLUE
,ǸEUTRAL
for teams ;READY
to set player ready for game start ; and.
for none.
- sends
DISCONNECT <Username> END
and receivesDISCONNECTED <Username> END
as a confirmation before quitting the game.
- Client sends periodically
PING <clock_time> END
and receives the same message to estimate the ping with the server. - When the game has started, the ̀
STATE <Player_List>
becomesSTATE <Player_List> SHADES <Shades_List>
to communicate to each client the things they can see or not. - To recognize if the game is currently played or if players are in the lobby, the server sends
LOBBY <Ready_Players_List> END
if the server is in a LOBBY state, which allow clients to display players which are ready to launch the game. It sendsGAME <Time> END
if the server is ingame,<Time>
being the remaining time for seekers to hunt. - To identify transition states, the server sends either
TRANSITION_GAME_LOBBY <Message> END
orTRANSITION_LOBBY_GAME <Message> END
to respectively inform clients the server is in a transition state from GAME to LOBBY, or LOBBY to GAME,<Message>
being the text to display on clients screens : such as the remaining time before the switch and the team that has won the game.