PACMAN but with guns !!!!
used standard binaries :
- stdio.h
- SDL.h
- SDL_ttf
- pthread.h
- time.h
- stdint.h
- netinet/in.h
- arpa/inet.h
- string.h
- cstdlib
- iostream
- unistd.h
- sys/types.h
- sys/wait.h
- sys/socket.h
- netdb.h
- signal.h
- stdlib.h
-> all except SDL_ttf.h and SDL.h are standard c++ libraries, and hence do not require any extra installation
in the console enter:
-> make
: to compile the code
-> ./game
: to run the generated executable
-> the game can be played by a maximum of 10 players (1 pacman and 9 demons)
-> the server takes the role of pacman
-> each client is a demon
-> all players (demons or pacman) can move freely in all four directions using the arrow keys, as long as they are not being blocked by a wall
-> pacman needs to eat all the coins spread throughout the maze to win
-> demons must collectively kill the pacman a total of 5 times to win
-> all players (demons and pacman) can shoot bullets in their current direction of movement using the "z" key.
-> demons win if pacman dies 5 times, hence pacman must play smart to survive
-> however, demons must stay careful, pacman shoots bullets too
-> data transmission between the server and client over udp
-> SDL rendering of frames generated by a mosaic of textures
-> large number possible maze structures
-> kill count maintained for each player
-> no closed loops can be formed in the maze to prevent pacman from spawning into an unwinnable situation
Networking :
- https://softwareengineering.stackexchange.com/questions/342254/tcp-or-udp-for-a-multiplayer-game
- https://techdifferences.com/difference-between-tcp-and udp.html#:~:text=Key%20Differences%20Between%20TCP%20and%20UDP%201%20TCP,proper%20delivery%20of%20packets.%20...%20More%20items...%20 (Basically helped me conclude that UDP is better, and TCP features can be used for critical information, over UDP)
- https://www.reddit.com/r/gamedev/comments/93kr9h/recommended_c_udp_networking_library/ (Networking libraries)
SDL : https://www.geeksforgeeks.org/sdl-library-in-c-c-with-examples/ (Renders image that can be moved using keyboard keys)
GitHub Games : https://github.com/maciejspychala/sdl-game
SDL ttf (for font):
- CleverRaven/Cataclysm-DDA#30931
- https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.pdf
- https://www.libsdl.org/projects/SDL_ttf/docs/index.html
- since maze was to be randomly generated it needed to use the same seed for all the game clients on the same server => the players need to enter the same maze_code which is used as a seed to run the game
- coins are consumed by pacman, so are hence only removed on comsumption on the server side => only the server renders coins, clients use a different rendering procedure which does not render coins