fix: correction d'erreur dans le choix de bonne sortie
This commit is contained in:
@@ -15,7 +15,7 @@ export function drawMaze() {
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||||
|
||||
for (let y = 0; y < maze.length; y++) {
|
||||
for (let x = 0; y < maze.length; x++) {
|
||||
for (let x = 0; x < maze[y].length; x++) {
|
||||
if (maze[y][x] === 1) ctx.fillStyle = "#333";
|
||||
else if (maze[y][x] === 2) ctx.fillStyle = "gold";
|
||||
else ctx.fillStyle = "#eee";
|
||||
|
||||
@@ -12,9 +12,10 @@ import { showGameOver, showVictory, updateTimerDisplay } from "./ui.js";
|
||||
|
||||
setupMovement();
|
||||
|
||||
socket.on("status", (msg) => console.log("Status: ", (msg));
|
||||
roleState.current = role;
|
||||
socket.on("status", (msg) => console.log("Status: ", msg));
|
||||
|
||||
socket.on("role", (role) => {
|
||||
roleState.current = role;
|
||||
if (role === "explorateur") {
|
||||
render();
|
||||
} else {
|
||||
|
||||
16
client/js/maze.js
Normal file
16
client/js/maze.js
Normal file
@@ -0,0 +1,16 @@
|
||||
/*
|
||||
maze.js
|
||||
1 = mur
|
||||
0 = chemin
|
||||
2 = porte
|
||||
*/
|
||||
|
||||
export const maze = [
|
||||
[1,1,1,1,1,1,1],
|
||||
[1,0,0,0,1,0,1],
|
||||
[1,0,1,0,1,0,1],
|
||||
[1,0,1,0,1,0,1],
|
||||
[1,0,1,1,1,0,1],
|
||||
[1,0,0,0,0,0,1],
|
||||
[1,1,2,1,1,2,1]
|
||||
];
|
||||
Reference in New Issue
Block a user