Snaxe: Hours 8-9

Submitted by davidc on Thu, 15/09/2011 - 17:39

More of the client-server communication is now implemented. The client is now put into the queue (and sent a message) after they enter their name. The server now broadcasts a 'gameover' to all clients on startup, in case any clients are stuck in the game from a server crash.

The 'insert coin' state now lists players in the order that they joined the queue, and the 'play' state now adds players to the game in that same order.

I've set up all the start positions for the various game sizes from 2-8 players. Pictured below is the 8-player arrangement. Snakes are now initially only 2 squares long rather than 4. And they now have guaranteed unique colours rather than random ones.

Powerups are now placed such that they never land on an existing piece or snake part (previously was completely random). Board pieces like skulls and rabbits now have a lifespan in moves, which is random within a configured range.

Local player key handling is refactored to be less of a giant mess of conditionals. The game now properly ends if all players are dead. Finally, I realised that the projector is 1024x768 but I've been developing at 800x600. I think the answer is to scale up the board, as I don't think it should have any more squares.

The next steps are to finish up the client-server protocol implementation, make the game return to the 'insert coin' screen after game over, and start work on some of the new features mentioned in a previous post.

Next: Hours 10-12.