(Untitled)

Nov 21, 2011 23:33

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... )

adventures in linuxland, game dev, course, html5, web geek

Leave a comment

Comments 3

tsuki_chama November 22 2011, 22:35:46 UTC
Nice! I am jealous - my own forays into HTML5/JS game-writing have been full of fail.

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

eldritchreality November 23 2011, 10:31:01 UTC
That's a problem with doing it all in css3 like the assignement wants me to.

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

tsuki_chama November 23 2011, 21:04:49 UTC
Can you not get over the positioning problem by declaring them all to be floating with an position:absolute;top:0;left:0?

I've never used (or heard of!) npm before, but I'll give that a shot.

Reply


Leave a comment

Up