Skip to content
Snippets Groups Projects
Commit cfe3a2fd authored by oumaima laklouch's avatar oumaima laklouch
Browse files
parents f153636c f54a11e2
No related branches found
No related tags found
No related merge requests found
# Connect4
By Ulysse DURAND
By Ulysse DURAND and Oumaima Laklouch
## Cahier des charges
......
{"test2":1,"aaa":1,"bbb":2,"fff":1}
\ No newline at end of file
{"test2":1,"aaa":2,"bbb":4,"fff":1,"ulysse":1,"testA":1}
\ No newline at end of file
......@@ -156,6 +156,7 @@ h1 {
});
socket.on('updateHOF', (hof) => {
console.log("coucou");
const hofList = document.getElementById('hof-list');
hofList.innerHTML = Object.entries(hof)
.sort((a, b) => b[1] - a[1])
......
File added
......@@ -44,6 +44,7 @@ io.on('connection', (socket) => {
socket.on('askRooms', () => {
io.emit('updateRooms', rooms);
io.emit('updateHOF', hallOfFame);
});
let stopGame = (room, roomId) => {
......@@ -96,7 +97,6 @@ io.on('connection', (socket) => {
socket.join(roomId);
io.emit('updateRooms', rooms);
io.to(roomId).emit('updatePlayers', room.players);
if (room.players.length === 2) {
startGame(room, roomId);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment