Day 5 - Player hands and beginnings of the grid
I stayed up a little longer to tinker and managed to get a few key items implemented.
First, I added a grid type to the model, because the card game I'm making is going to involve cards being placed into the "flow of magic", a 4x3 grid of cards. Each turn, the cards on the outside of the grid will rotate and activate depending on where they are placed. My current model for "spaces" keeps all of the card data in a list. Rather than make the grid type a separate concept, I've added an organization field, in addition to the list of card data. This field keeps track of which position each card is in. Eventually I'll need to add helper methods to make accessing the card data according to positions a bit easier.
Then, I modified my game interface code to strip out the temporary card fields that were there previously, implementing things more like what will actually be in the game. I started with the player's hands. Now, I show your hand on the bottom of the screen, and your opponent's on the top. When the opponents hand is displayed, I also overwrite the source images with the card backs so you can't see their cards. I also improved the layout: I had to shrink the cards down to make room for the grid, which then necessitated a way to zoom in on the cards in order to read them. Finally, I made the animation code for the cards happen one by one rather than all at once. This isn't too important now, but the game is likely going to have 3 or 4 actions pop off when you end your turn, and it needs to be a little more clear what is going on.
Another minor addition I haven't posted here yet is the ability to choose your login account, as well as either creating a new game, joining an open game, or resuming a game you have in progress.
(log in to comment)