Skip to content

Gestion/Envoie des coordonnées depuis le serveur#144

Open
rthoreau wants to merge 3 commits intoecvdbdx:masterfrom
rthoreau:issue-129
Open

Gestion/Envoie des coordonnées depuis le serveur#144
rthoreau wants to merge 3 commits intoecvdbdx:masterfrom
rthoreau:issue-129

Conversation

@rthoreau
Copy link
Contributor

  • Création d'un ID lorsque l'utilisateur se connecte
  • Envoie des coordonnées depuis le serveur
  • Reception côté client des positions des snakes et apples (il manque la création des nouveaux serpents et le dessin sur le canvas)

Copy link
Contributor

@DavidBruant DavidBruant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need an ESLint run as well

this.checkCollisionWithApples();
// END TEMP
}, constant.DELAY);
render(snakes, apples){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the board already has the snakes and apples as property. It shouldn't need them as arguments

}else{
console.log('màj');
snake.x = laonsaitpas.x;
snake.y = laonsaitpas.y; // trouver l'ordre à faire, pour créer les serpents non existant, et màj les serpents déjà dans board.snake
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs fixing

serverObject.emit('joinGame', apples);
});

socket.on('sendPositions', function(snakes, apples) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't use a verb to name an event


socket.on('snakeNew', name => {

var id = identifier(constant.ID_SIZE);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably a case where you don't need a constant and it can just be hardcoded

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants