Sunday, May 18, 2008

XMLRPC Cardgame Client

Before I can pick up Sylva again, I'm trying to get this client for my XMLRPC Cardgame Server done.

The idea behind it is that it is a Cairo surface that, when something changes on the table, an svg string is changed to change the display of the window. For example, a card gets added to the table, so an svg representation of the card is added to the main svg, then the cairo surface is refreshed, showing the card on the table. The only problem with this, is that it has no inherent ability to detect if a particular element of the surface is clicked, as it's just one big image. However, I plan on adding bounding boxes and such as detected from the svg's canvas size. This should work, even with the rescaling feature I have set up now.

However, before I add the click detection to the svg elements, I'd like to replace that menubar at the top of the window with a right-click pie menu. I'm going to be using Don Hopkins' piemenu.py module he wrote for the OLPC Sugar project, since it's the only real pygtk implementation of piemenus available. For now, it's just a matter of adding it...Oh wait, there it goes. Okay, then now it's just a matter of making it do the right things when clicked, and then hiding that menu bar, and then showing it if the user hits "alt".

Once that's done, next thing up is working on the gui. Specifically getting card info from the server, and showing that data in a meaningful manner.

Monday, May 5, 2008

XMLRPC Cardgame client/server

No, I havnt touched Sylva since I posted last.

I've been working on a little client/server project lately, using XML-RPC and Python. It's my first foray into unit tests and I have to say, I'm quite pleased. Not only does it provide a use-case for each function, but it also assures me I didnt break something horribly. (Which I did once but the unittests caught it.)

Anyway, the idea is that it is able to handle any game where you move bits of data from one area to another. IE, Cards. You have a deck, and a discard pile, and a hand, etc. which you put cards into, then move them around. It doesnt enforce any rules, and even has unix-y permissions. It's great for Nomic cardgames, as well as cardgames like Dvorak or even my own baby, Libre. It's coming along nicely, and I should be done within the week(?) barring Finals interfering and such. I'm aiming to have at least the server done before I have to devote my Summer to Sylva. The worst part is, the client's still not done even once I finish the server :P

See https://launchpad.net/xmlrpc-cardgame for the bzr branch.