I've been wanting to program a web based game for some time. I spoke about an OOP method for doing card games. I wanted to do something more advanced and gamer like then a poker web game. Something with more then one player and interacting with other users. I found one.
I have a friend producing a small box game called The Hell of Stalingrad. This game simulates the battle of Stalingrad in World War II. It uses cards for locations and to fight the battle with little pieces and dice rolls.
There are a few differnt types of cards that will be come differnt decks. One Deck will be the location deck, the others are the formation cards (representing millitary assets),an event deck (effects of politcal and historical events), and a combat deck.
The location deck is each location in the city. Some of the location give each side bonuses and flaws to fight the battle there. For example one location maybe near the river. If this happens the Germans will win that location and only have to fight for the remaining 3 locations.
The formation deck is the troops to fight with they may be armour or infantry or mechinized. This formations can be given bonuses and effect the battle with the combat deck. They can also be depleted and resupplied this is a tapping and untaping effect.
I think this will be alot of fun with the silverlight pieces and a bit of a coding challange.
Showing posts with label games. Show all posts
Showing posts with label games. Show all posts
Thursday, February 5, 2009
Thursday, October 16, 2008
Correct Assumptions : More OOP With cards in games
I wrote the last post with out checking out what Micro Soft had to offer. I found that there is a card game starter kit. I downloaded it and began playing with it. I was shocked to see that what I was thinking would actually work for the handling of cards in a game.
The starter kit builds a blackjack game that you should be able to edit and expand. So i began poking around to see what was there that can be used and modded for my needs. I went to the Card Game Framework to see what was there. I found 3 classes (Card,Deck and Hand). These fit my assumptions with minor changes.
Card is built the way I assumed it would be. It encapsulates the values of the suit,faceValue, and isfaceup. This object is just for the play of this card in other collections. The values are set to private readonly fields or public get properties. That's actually good programing as it stops the programmer from attempting to change cards on the fly.
Deck unlike my deck has only one collection. It also has methods for shuffleing that collection.
Also it has a method for drawing a card. I think since black jack doesn't need a discard deck or to shuffle that deck back in those methods are missing. I can use this as an excellent start for my card based game. I can shuffle anything that looks like a deck. These can even be room tiles from games like house on hunted hill or other games with tiles.
Hand is a collection of cards and cantains a number of cards property. It's inherited by blackjack hand and hit has the rules for black jack in that. all this is wrapped by theanother class.
I know I'm on the write path to writing my game. I'm really excited by this and I can add the silverlight bits.
The starter kit builds a blackjack game that you should be able to edit and expand. So i began poking around to see what was there that can be used and modded for my needs. I went to the Card Game Framework to see what was there. I found 3 classes (Card,Deck and Hand). These fit my assumptions with minor changes.
Card is built the way I assumed it would be. It encapsulates the values of the suit,faceValue, and isfaceup. This object is just for the play of this card in other collections. The values are set to private readonly fields or public get properties. That's actually good programing as it stops the programmer from attempting to change cards on the fly.
Deck unlike my deck has only one collection. It also has methods for shuffleing that collection.
Also it has a method for drawing a card. I think since black jack doesn't need a discard deck or to shuffle that deck back in those methods are missing. I can use this as an excellent start for my card based game. I can shuffle anything that looks like a deck. These can even be room tiles from games like house on hunted hill or other games with tiles.
Hand is a collection of cards and cantains a number of cards property. It's inherited by blackjack hand and hit has the rules for black jack in that. all this is wrapped by theanother class.
I know I'm on the write path to writing my game. I'm really excited by this and I can add the silverlight bits.
Subscribe to:
Posts (Atom)
