🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Where to start writing a card game?

Started by
1 comment, last by Kostia 22 years, 10 months ago
Hi, I would like to write a multiplayer card game. As far as I understand it is going to be fairly simple compared to all the other things that have been done before. However, I have never written a game and do not even know where to start. I am thinking of having a field, playing cards, mixing cards, limiting number of cards, dividing cards among players with particular count and then players playing. Where do I start? Where can I get a free starter kit for this? Is there anything like that? I would think that there is because I do not believe for one that everyone makes their own pics of cards. I appreciate any and all help! Thanks, Kostia kostia_greb@yahoo.com
Advertisement
Your probably better off writing it in something simple like Flash, java-script, CGI, or PHP because it takes more effort to learn how to do something like that in C++ than it does to make it ^^

"I''''ve sparred with creatures from the nine hells themselves... I barely plan on breaking a sweat here, today."~Drizzt Do''''Urden
------------------------------Put THAT in your smoke and pipe it
Go here

Here is some information on using the standard cards32.dll I believe it is what most card games use. It''s purpose is to draw the cards where you tell it too.

The rest of the stuff are just problems for you to figure out your own logical solution to. There are multiple ways to solve each.

For example, many (most?) card games store the deck as an array of integers from one to 52, each number representing a card.

1 - Ace of spades
2 - Ace of clubs
3 - ace of hearts
4 - ace of diamonds
5 - two of spades
.
.

i think you get the point. By using that particular method, the pip value (number) of the card is found by seeing how many times 4 goes into the number evenly, plus one.

CardPip=int(cardnumber/4)+1

and the suit is found by checking the remainder of the number divided by 4.

Shuffling then comes down to randomly switching the cards. In VB it is simply done by:

For currentcard=1 to 52
toswtchwth=int(rnd*52)+1
temp=deck(toswtchwth)
deck(toswtchwth)=deck(currentcard)
deck(currentcard)=temp
Next currentcard

if you''ve done much programming, then figuring the rest out shouldn''t be too hard. If you havn''t done programming before, then I suggest forgetting about a card game, and go out and buy a programming book, read it (doing all the examples), read it again, read it again, read it again... And then coming back to write the card game.

Hope that helps you some.


Drakonite

[Insert Witty Signature Here]
Shoot Pixels Not People

This topic is closed to new replies.

Advertisement