imalooney / t3tr0s

30th anniversary tetris in ClojureScript
t3tr0s.com
Other
468 stars 28 forks source link

Dashboard should update board if it's not displaying #12

Closed oakmac closed 10 years ago

oakmac commented 10 years ago

If Player A is playing during battle mode and switches his browser tab off of the game, the dashboard no longer updates his board.

oakmac commented 10 years ago

bumping this; would really help with the new dashboard

shaunlebron commented 10 years ago

Writing my thoughts here.

Need to just send board updates to server in go-go-gravity!

oakmac commented 10 years ago

Sounds right. Basically we need to separate the game state logic from the rendering logic.

Ideally the entire application only has one state at any given time (boards, scores, chat, players, etc).

This gets continuously updated from one client to server, then from server to all clients via one method of transport.

Then it's up to the client to intelligently render the game state as appropriate (ie: based on what page you're on, requestAnimationFrame, etc)

shaunlebron commented 10 years ago

Board updates can be emitted to the server as often as 60 times per second. Any change in the board will trigger an emit in the next frame. This works like requestAnimFrame, except it continues when the window is minimized.