I've finally completed the meat of week 3's exercise.
It's ugly as sin but it works.
It's a multiplayer server on
http://game.racheet.me:1337 Currently, little green squares can move around the screen together across the internets.
If multiple people are on it concurrently they each get a
(
Read more... )
Comments 3
Incidentally, do the blob positions update properly in multiplayer for you? When I open the game in two tabs (Chrome/Linux), each one sees the other move, but the movement doesn't quite match up. e.g. in Player 1's tab, I move 1 from below 2 to above 2. In Player 2's tab, 1 has moved, but not all the way to the "above 2" point.
Reply
Since css3 transforms all work using the element's place in the normal page flow as the origin, and since when a new player is added to the page, it is added below the previous player, their y origins differ by the sum of previous player heights.
Also the collision detection function I wrote last night doesn't seem to be detecting collisions so much as scrambling their positions slightly, but I collapsed in exhaustion before I could fix it. It worked considerably better when I wrote that LJ post.
There's a copy of that more functional version in a zip file on racheet.me/game/assignment3, but you'll need to apt-get node.js and npm and then npm socket.io to run it.
Reply
I've never used (or heard of!) npm before, but I'll give that a shot.
Reply
Leave a comment