I started Forge, which is an open-source, free project that lets you play Magic: The Gathering against the computer. Currently other people are updating Forge and there will be no more posts to this blog.
I started Forge, which is an open-source, free project that lets you play Magic: The Gathering against the computer. Currently other people are updating Forge and there will be no more posts to this blog.
This seems like a strange coincidence. I just started thinking about programming a Magic the Gathering card game recently as well. I'm curious how you were able to get some of the abilities to work and how your classes worked? You mentioned having over 700 Classes. Did you have one for each card? The game is definitely very fun. I started doing it in OCaml. That's my programming language of choice, although I do have some experience with Java. Is the code available on Sourceforge? I would like to take a look at how you did this.
ReplyDeleteAll the code is available at SourceForge, but not in the CVS. The source code is in the zip file that you can download, not the exe.
ReplyDeleteI got spells/abilities to work by making them one class.
class SpellAbility
{
abstract void resolve()
}
Every spell or ability had to override resolve(). All the game zones like "cards in play" were global variables.
I'm glad you enjoy it. I play it almost every day. I love the "generate sealed deck" option.
I think every programmer thinks about "programming Magic." Currently I can only program a few cards. I'm working on version 2.