Simple snake game using some DDD and Clean Architecture methods
pip3 install pynput
- Open two terminals and place them side by side
- start server in one terminal:
python3 server.py
- start client in another terminal:
python3 client.py
- collision checking with walls
- collision checking of the snake against itself
- snake cannot rotate 180 degrees
- update rate 0.5 s
- a user can control the snake over udp with w, a, s ,d keys
- each 5 s client sends to server random valid food position
- playfield size can be changed with width and heigh variables in the code
- initial snake has 3 elements (head, tail, tail)
- # for walls, * for food, h for head, s for tail