Code Monkey home page Code Monkey logo

pacman_2077's Introduction

Pacman_2077

PACMAN but with guns !!!!

Requirements

used standard binaries :

  1. stdio.h
  2. SDL.h
  3. SDL_ttf
  4. pthread.h
  5. time.h
  6. stdint.h
  7. netinet/in.h
  8. arpa/inet.h
  9. string.h
  10. cstdlib
  11. iostream
  12. unistd.h
  13. sys/types.h
  14. sys/wait.h
  15. sys/socket.h
  16. netdb.h
  17. signal.h
  18. stdlib.h

-> all except SDL_ttf.h and SDL.h are standard c++ libraries, and hence do not require any extra installation

Compiiling and running the game

in the console enter:
-> make : to compile the code
-> ./game : to run the generated executable

Rules of the game

-> 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

Features

-> 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

Resources used

Networking :

  1. https://softwareengineering.stackexchange.com/questions/342254/tcp-or-udp-for-a-multiplayer-game
  2. 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)
  3. 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):

  1. CleverRaven/Cataclysm-DDA#30931
  2. https://www.libsdl.org/projects/SDL_ttf/docs/SDL_ttf.pdf
  3. https://www.libsdl.org/projects/SDL_ttf/docs/index.html

Issues faced

  1. 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
  2. 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

pacman_2077's People

Contributors

jainaryan1310 avatar avantikaag03 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.