I don’t have anything specific to write about today. I’ve done a lot of work on MTG Forge version 2, mostly “background code” that handles mouse clicks and stuff that is taken for granted. Thankfully the background code doesn’t usually have to be updated, so once it is written, it works.
The user interface for version 2 is working. It looks exactly like the current user interface but it uses abstract interfaces for the visual components (see the previous article). Some of the basic components like how I handle the mouse are the same as version 1, I still use the Input class.
I have all of the dialog boxes working. Dialog boxes are the popup boxes that ask you “Do you want to pay 2 life?” Yes or No. I have dialog boxes that show one card, many cards, just to show a message and one that shows a message with the yes/no button. The dialog boxes are a good example of background code.
I first started on working on MTG Forge version 2 over a year ago but I’ve only worked on it off and on. Over the last few days I’ve worked on it like a madman at 2am, 4am, and 6am. Currently version 2 is 131 KB of code, while version 1 weighs in at a hefty 1,000 KB. You have to keep in mind that version 1 probably should be 50% smaller if all of the redundant code was removed. (I would tell you the number of lines that version 2 has but I would have to write a small program and I’ve kind of burned out at the moment.)
Right now version 2 has working life points, mana pool, and board (the zones your hand and in play). Also the mouse click event works when you click on the life points, mana pool, or a card on the board. The “card detail” window on the right also works.
The next step is to get the user interface to cycle through all of the phases and to allow the user to select which phases to stop. Hopefully after I do that, I can actually program a card or two. I really want to just program cards, all of the background code is just laying the foundation. I’m going to lay a solid foundation so I don’t have to ever touch it again.
p.s. Version 2 will have ALL of Magic’s phases, so you can stop whenever you want to.
p.s. You can check out a visual spoiler of Shard of Alara here. We can all drool over the mega rares, lols.