Magic the Gathering(5)
Done! Fully playable version of beta 1.01 is here. Code here.
6224 lines, 4717 lines of code, 865 lines of comments (poor documentation, I know…). There is still a lot of things to do and even some important features missing, but it works and you can enjoy playing Magic the Gathering via the Internet with your friends.
I was thinking a bit about my design and planning problems… If I had to rewrite this code (which I have even considered doing) I think I would do it in 5 thousand lines and without such a mess. I think the reason for that (i.e. my planning problems) is a lack of specification. When I start writing a program I don’t know what exactly I need. I think only about few features and over time think of additional features which were not predicted and therefore are difficult to implement with my current structure.
The greatest fun was with sending proper information to proper players, i.e. if player draws a card, all other players must see that, but must not see what card was drawn. I tried not to let players cheating and therefore they receive only necessary information about cards’ movements. Libraries are stored on the server and proper client receive them only on request (obviously with a proper note to all other clients). I don’t think that someone will hack my program, but it was nice experience and a part I liked the most.
I will keep working on this project if only there will be someone to play with me :) So if you would like to have a duel, let me know ;)