Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
VB Solitaire game
Name: Andrew Date: October 9, 2002 at 07:02:06 Pacific OS: Windows XP Pro CPU/Ram: 128
Comment:
I'm making a Solitaire program for a school roject, its written in VB6.0. For the "Deck" butttom (where you click to get the three cards to pop up, if you dont understand start up windows solitaire and see) How could i program it to generate three random cards, that arent already in use, with the pictures on them?
Name: Spencer Ruport Date: October 9, 2002 at 08:51:04 Pacific
Reply:
I think the easiest way to approach this would be to make a card class and then make an array of cards.
Dim Card(52) as Card
The card class would need these properties: .location (certain code for where it's placed on the table) .name .faceup (Boolean) .image (Number referring to the image object index)
You will also need to make an object array of 53 images with the card face. (52 cards plus the back of the card.)
From here you need to make subs such as
NewGame() Where you would make a fresh deck Shuffle() A shuffling function to swap the cards around Deal() Changing the location and faceup properties for each card based on it's index value. Display() Going through your card array and placing the correct image in the area denoted by .location.
Summary: "But if U are planning for VB.NEt then I suggest U start with VB 6 first. Its not only easy to learn , but it will also help U to learn VB.NET easily." No way...That would be a complete waste of time....
Summary: Anyway u can run the cmd with the /C option with the shell funtion that works eg: Shell "cmd /C sol",vbhide this line will start the solitaire game. ...
Summary: Hi All, Here is a game developed be me on Visual Basic 6. It is very simple but very entertaining Isometric Game. Its called "2D Thief" based on 3D Thief. http://www.geocities.com/sams_gamerock/samis...