|
-
Dec 9th, 2005, 05:42 AM
#1
Thread Starter
New Member
Solitaire
Hi guys
Over christmas and next year I'm having to make a solitaire card game (Like the windows Version) in VB for my final year project. I was just wondering if any off you had any tips as to how I should go about starting it. At the moment I've thought about having group boxes you layout the cards but I don't know how easy it will be to program all the functions and rules using group boxes. I have to use a card class also which ruined my plans of using the windows card32.dll 
Thanks for any help you could give me.
Dooks
-
Dec 10th, 2005, 12:04 PM
#2
Frenzied Member
Re: Solitaire
Food for thought:
-make a Card class
Cards have a value and can be hidden or exposed.
The Card can draw itself on the screen.
-make a Deck class
The Deak creates Cards and gives them values so they form a complete deck.
When requested, the Deck will pick a Card at random, give it to the asker and delete the Card from it's own collection.
-make a Stack class
The Stack has a size and a sequence of Cards.
When the Stack is initialized it will request Cards from the Deck until it has reached it's size, then it will hide all Cards except it's top Card.
When the Stack is clicked it will first decide which Card is clicked on.
If that Card is hidden and the top Card then that card will become exposed.
If the Card is hidden and not the top Card then nothing will happen.
If that Card is exposed then that Card and all Cards above it will be copied into a TempStack.
The Stack will remember to which TempStack it gave the cards and will accept any sequence of Cards from that TempStack.
The Stack can draw itself by making it's Cards draw themselves in sequence.
When a Card is dropped onto the Stack then the Stack will only accept the Card if the Stack's top card is exposed and the Card dropped onto it is exactly 1 lesser than the top Card.
-make a TempStack class
The TempStack contains Cards just like a Stack except that it only takes exposed Cards from a Stack.
The tempStack remembers where the Cards came from.
When a TempStack is dropped onto another Stack it will first attempt to drop the bottom card onto the destination Stack.
If the Card is accepted then it will drop the rest of the Cards.
If the card is denied then it will drop all the Cards back onto the Stack where they came from.
After dropping the Cards the TempStack must be destroyed.
Last edited by jeroen79; Dec 10th, 2005 at 12:07 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|