Skip to content

Set clock on server side#135

Open
Laguigue wants to merge 1 commit intoecvdbdx:masterfrom
Laguigue:issue-129
Open

Set clock on server side#135
Laguigue wants to merge 1 commit intoecvdbdx:masterfrom
Laguigue:issue-129

Conversation

@Laguigue
Copy link
Contributor

@Laguigue Laguigue commented Jan 5, 2017

Une clock, pour les gouverner tous

server/index.js Outdated
});
});
setInterval(function() {
b.render();
Copy link
Contributor

Choose a reason for hiding this comment

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

This will fail. The server-side shouldn't be doing rendering. There is no canvas or document on the server.
Currently, the render function does 2 things:

  1. compute positions & check for collisions (which is just math & coordinate/booleans calculations)
  2. actually draw things on a canvas

These should be separated into 2 functions. The former will be called server-side; the latter will be called client-side upon receiving all positions and stuff

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.

2 participants