Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplayer ludo game #3034

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions Games/Multiplayer_Ludo_Game/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# **Multiplayer Ludo Game**

---

<br>

## **Description 📃**
A multiplayer Ludo game for 2 to 4 players
-

## **functionalities 🎮**
The game can be played by up to 4 players
Players can choose their nicknames
No safe zone
-
<br>

## **How to play? 🕹️**
Each player has 4 counters,
The player must roll a "6" to be allowed to remove a pawn from the base,
The player may replay once he has rolled a "6",
The player must make each of his pawns complete a full turn and enter the home,
When an enemy pawn arrives on the square we occupy, our pawn returns to the base.
-

<br>

## **Screenshots 📸**

<br>
Menu

![image](./assets/images/Screen1.png)

<br>
Game

![image](./assets/images/Screen2.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Games/Multiplayer_Ludo_Game/assets/images/horse-blue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Games/Multiplayer_Ludo_Game/assets/images/horse-green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Games/Multiplayer_Ludo_Game/assets/images/horse-red.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Games/Multiplayer_Ludo_Game/assets/images/horse-yellow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
122 changes: 122 additions & 0 deletions Games/Multiplayer_Ludo_Game/common/constant2player.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
export const config = JSON.parse(localStorage.getItem('config') ?? null);

export const COORDINATES_MAP = {
0: [6, 13],
1: [6, 12],
2: [6, 11],
3: [6, 10],
4: [6, 9],
5: [5, 8],
6: [4, 8],
7: [3, 8],
8: [2, 8],
9: [1, 8],
10: [0, 8],
11: [0, 7],
12: [0, 6],
13: [1, 6],
14: [2, 6],
15: [3, 6],
16: [4, 6],
17: [5, 6],
18: [6, 5],
19: [6, 4],
20: [6, 3],
21: [6, 2],
22: [6, 1],
23: [6, 0],
24: [7, 0],
25: [8, 0],
26: [8, 1],
27: [8, 2],
28: [8, 3],
29: [8, 4],
30: [8, 5],
31: [9, 6],
32: [10, 6],
33: [11, 6],
34: [12, 6],
35: [13, 6],
36: [14, 6],
37: [14, 7],
38: [14, 8],
39: [13, 8],
40: [12, 8],
41: [11, 8],
42: [10, 8],
43: [9, 8],
44: [8, 9],
45: [8, 10],
46: [8, 11],
47: [8, 12],
48: [8, 13],
49: [8, 14],
50: [7, 14],
51: [6, 14],

// HOME ENTRANCE

// P1
100: [7, 13],
101: [7, 12],
102: [7, 11],
103: [7, 10],
104: [7, 9],
105: [7, 8],

// P2
200: [7, 1],
201: [7, 2],
202: [7, 3],
203: [7, 4],
204: [7, 5],
205: [7, 6],

// BASE POSITIONS

// P1
500: [1.5, 10.58],
501: [3.57, 10.58],
502: [1.5, 12.43],
503: [3.57, 12.43],

// P2
600: [10.5, 1.58],
601: [12.54, 1.58],
602: [10.5, 3.45],
603: [12.54, 3.45],
};

export const STEP_LENGTH = 6.66;

export const PLAYERS = ['P1', 'P2'];

export const BASE_POSITIONS = {
P1: [500, 501, 502, 503],
P2: [600, 601, 602, 603],
}

export const START_POSITIONS = {
P1: 0,
P2: 26
}

export const HOME_ENTRANCE = {
P1: [100, 101, 102, 103, 104],
P2: [200, 201, 202, 203, 204]
}

export const HOME_POSITIONS = {
P1: 105,
P2: 205
}

export const TURNING_POINTS = {
P1: 50,
P2: 24
}

export const STATE = {
DICE_NOT_ROLLED: 'DICE_NOT_ROLLED',
DICE_ROLLED: 'DICE_ROLLED',
}
141 changes: 141 additions & 0 deletions Games/Multiplayer_Ludo_Game/common/constant3player.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
const config = JSON.parse(localStorage.getItem('config') ?? null);

export const COORDINATES_MAP = {
0: [6, 13],
1: [6, 12],
2: [6, 11],
3: [6, 10],
4: [6, 9],
5: [5, 8],
6: [4, 8],
7: [3, 8],
8: [2, 8],
9: [1, 8],
10: [0, 8],
11: [0, 7],
12: [0, 6],
13: [1, 6],
14: [2, 6],
15: [3, 6],
16: [4, 6],
17: [5, 6],
18: [6, 5],
19: [6, 4],
20: [6, 3],
21: [6, 2],
22: [6, 1],
23: [6, 0],
24: [7, 0],
25: [8, 0],
26: [8, 1],
27: [8, 2],
28: [8, 3],
29: [8, 4],
30: [8, 5],
31: [9, 6],
32: [10, 6],
33: [11, 6],
34: [12, 6],
35: [13, 6],
36: [14, 6],
37: [14, 7],
38: [14, 8],
39: [13, 8],
40: [12, 8],
41: [11, 8],
42: [10, 8],
43: [9, 8],
44: [8, 9],
45: [8, 10],
46: [8, 11],
47: [8, 12],
48: [8, 13],
49: [8, 14],
50: [7, 14],
51: [6, 14],

// HOME ENTRANCE

// P1
100: [7, 13],
101: [7, 12],
102: [7, 11],
103: [7, 10],
104: [7, 9],
105: [7, 8],

// P2
200: [1, 7],
201: [2, 7],
202: [3, 7],
203: [4, 7],
204: [5, 7],
205: [6, 7],

// P3
300: [7, 1],
301: [7, 2],
302: [7, 3],
303: [7, 4],
304: [7, 5],
305: [7, 6],

// BASE POSITIONS

// P1
500: [1.5, 10.58],
501: [3.57, 10.58],
502: [1.5, 12.43],
503: [3.57, 12.43],

// P2
600: [1.5, 1.58],
601: [3.57, 1.58],
602: [1.5, 3.45],
603: [3.57, 3.45],

// P3
700: [10.5, 1.58],
701: [12.54, 1.58],
702: [10.5, 3.45],
703: [12.54, 3.45],
};

export const STEP_LENGTH = 6.66;

export const PLAYERS = ['P1', 'P2', 'P3'];

export const BASE_POSITIONS = {
P1: [500, 501, 502, 503],
P2: [600, 601, 602, 603],
P3: [700, 701, 702, 703],
}

export const START_POSITIONS = {
P1: 0,
P2: 13,
P3: 26
}

export const HOME_ENTRANCE = {
P1: [100, 101, 102, 103, 104],
P2: [200, 201, 202, 203, 204],
P3: [300, 301, 302, 303, 304]
}

export const HOME_POSITIONS = {
P1: 105,
P2: 205,
P3: 305
}

export const TURNING_POINTS = {
P1: 50,
P2: 11,
P3: 24
}

export const STATE = {
DICE_NOT_ROLLED: 'DICE_NOT_ROLLED',
DICE_ROLLED: 'DICE_ROLLED',
}
Loading
Loading