Skip to content
/ Mafia Public

Mafia ๐ŸŽญ is a fast-paced social deduction game where players take on roles like Mafia, Doctor, Prankster and Police. ๐Ÿ•ต๏ธโ€โ™‚๏ธ Use deception and strategy to outwit your opponents in this thrilling game of survival. ๐Ÿ’€ Can you identify the Mafia or survive as one?

License

Notifications You must be signed in to change notification settings

meet244/Mafia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

25 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Frame 22

Mafia is a thrilling social deduction game where deception and strategy are key to survival. This game is developed using HTML, CSS, and JavaScript, with a Flask backend hosted on Vercel. Playable on both mobile and desktop screens, Mafia offers an engaging experience for all players. The game includes sound effects to enhance the experience, with audio cues for kills, votes, and other key moments.

Game Rules

Roles ๐ŸŽญ

  1. Mafia (Killer) - Kills one person per night.๐Ÿ”ช

  2. Doctor - Saves one person per night.๐Ÿฉบ

  3. Police - Investigates one person per night to determine if they are the Mafia.๐Ÿ‘ฎโ€โ™‚๏ธ

  4. Prankster - Pranks one person per night, preventing them from using their power.๐ŸŽญ

  5. Civilian (Villager) - A normal villager with no special powers.๐Ÿ‘ค

Game Flow ๐ŸŒ™๐ŸŒž

Joining the Game ๐ŸŒ

Go to MAFIA website. Enter your name and join a room. You can create a new room or join an existing one. The host will start the game, and each player will receive a role card.

Night Phase ๐ŸŒ™

Depending on your role, you will perform the following actions:

  • Mafia: Choose one player to kill.๐Ÿ’€
  • Doctor: Choose one player to save.๐Ÿ›ก๏ธ
  • Police: Choose one player to investigate.๐Ÿ”
  • Prankster: Choose one player to prank.๐ŸŽ‰
  • Civilian: Your choice does not affect the game.๐Ÿ‘ค

Day Phase ๐ŸŒž

  • Discussion Round: Players discuss who they think the Mafia is.๐Ÿ—ฃ๏ธ
  • Voting Round: Players vote on who they think the Mafia is.๐Ÿ—ณ๏ธ
  • Voting Results: If the Mafia is voted out, the game ends. If not, the game continues to the next night phase.โ™ป๏ธ

Winning the Game ๐Ÿ†

The game continues until either the Mafia is voted out or the Mafia successfully kills all other players.

Screenshots ๐Ÿ“ธ


Mobile ๐Ÿ“ฑ m1 m2 m3 m4 m5 m6 m7

Desktop ๐Ÿ’ป pc1 pc2 pc3 pc4

Game Flow Diagram ๐ŸŽจ

For a visual representation of the game flow and states, refer to the diagram given below.

image 10 (1)

Game Designs ๐ŸŽจ

Website designs (low fidelity) ๐Ÿ“:
Designs (low fidelity)

All game dev components used can be found here.

File Structure

Mafia game project structure:

  • API Folder ๐Ÿ“
    1. app.py: Main server file.๐Ÿ–ฅ๏ธ

    2. templates folder:๐Ÿ“„

      • create.html: Create a new game room.
      • index.html: Check if the game is working (old play.html).
      • join.html: Join a game room.
      • landing.html: Landing page for the main game.
      • main.html: Previous landing page (old landing.html).
      • play.html: Main file for playing the game.
      • spectator.html: Spectator page to watch the game.
      • UI.html: Basic UI components for development.
    3. Static folder:๐Ÿ–ผ๏ธ๐Ÿ”Š

      • assets folder: SVG images.
      • audio folder: Audio files.
      • images folder: JPG or PNG images.

Background ๐Ÿ“œ

The game was inspired by the traditional Mafia game played with friends using chats and a human host. This digital version automates the process, making it faster and more convenient, allowing everyone to participate without the need for a dedicated host.

How we used to play... ๐ŸŽฒ

We used to make paper chits or cards, and in those chits, we would write the names of the roles like Civilian, Mafia, Police, and others. These chits were then distributed among the players. There would be a god or a host who controlled the entire game. The host would ask everyone to close their eyes, then call on the Mafia to open their eyes and choose someone to kill. Afterward, the Doctor would open their eyes and choose someone to save. The game was very sequential, with each role acting one after another, making the process quite lengthy and sometimes frustratingly slow. The entire game took a lot of time.

Additionally, some players used to cheat between rounds, trying to gain an advantage by peeking or signaling to each other. This added an extra layer of challenge and suspicion to the game.

Chits game

Contribution ๐Ÿค

If you encounter any issues or have suggestions for improvements, feel free to raise an issue or contribute to the project.


Thank you for playing Mafia! Enjoy the game and may the best detective win.๐Ÿ•ต๏ธโ€โ™‚๏ธ

About

Mafia ๐ŸŽญ is a fast-paced social deduction game where players take on roles like Mafia, Doctor, Prankster and Police. ๐Ÿ•ต๏ธโ€โ™‚๏ธ Use deception and strategy to outwit your opponents in this thrilling game of survival. ๐Ÿ’€ Can you identify the Mafia or survive as one?

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published