I trying create simple Multi-player with HTML5 Canvas, JavaScript(too using John Resig simple Inheritance library) and Node.js with Socket.IO. My client code:
First, check out http://www.google.com/events/io/2011/sessions/super-browser-2-turbo-hd-remix-introduction-to-html5-game-development.html
it explains how to use requestAnimationFrame among other things.
Second, the game state should exist on the server and be mirrored on the clients.
When a player clicks down, the client should only send a message. The server should then send a message to all the clients, including the client that took the action.
Each player should exist as an object on the server. When a player logs in they should be brought up to date about the status of each player already on the server.
modified client code: http://codr.cc/s/d0154536/js
modified server code: http://codr.cc/s/f96ce1d2/js