Jump to content
  • Advertisement
Sign in to follow this  
cptrnet

Card Game Help

This topic is 4642 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to make BlackJack. For right now I am just using words to say what cards you have. I just want to know how they get the pictures. Do they draw each card for a total of 52 pictures? Or do they just draw a heart, club, spade, diamond, and the jack, queen, and king and dynamically arange them on a card? Is there a place where I could get the pictures or whatever. I kind of suck at drawing.

Share this post


Link to post
Share on other sites
Advertisement
Its really up to you, It will be easier to draw each card individuyally.

look in this thread for the images. There is a load of sites to get images from.
http://www.gamedev.net/community/forums/topic.asp?topic_id=272386

Share this post


Link to post
Share on other sites
The last time I did a card game was on a DOS-based system in Pascal. Do do this I shifted into ANSI text-mode and used the system's ASCII text set and color palette to draw the cards dynamically.

You could do something similar with sprites, or draw all of them individually. What OS are you doing this for? What language are you using? Is this your first foray into graphics?

Share this post


Link to post
Share on other sites
I quickly scanned the sprite sticky thread and it didn't look like this was in there. Cards. If I understand the license correctly, they're free to use and modify so long as you include a copy of the license.

I colourized those graphics for my own project here, though I couldn't get the original joker colourized so I made my own and added a couple different card backs.

Share this post


Link to post
Share on other sites
Ok, thanks for the cards. I do have another problem with my game right now. I need to know when an Ace will be used as a 1 or an 11. And when to give the dealer more cards. I am stumped. Oh by the way I am just using HTML and javascript right now for a web game.

Share this post


Link to post
Share on other sites
You may already know this, but you can use the win32 cards.dll. This allows you to make a game that looks very much like the built in windows card games. I found a site that wrote a very nice library around it that is very powerful, and I built a blackjack game around it. Here is the site: www.catch22.net/tuts/

By the way, here are a few others things you requested:
First, make a function that finds the value of a sequence of cards and. To emulate the dealer, check if the value is lower than 16. If it is, then give the dealer another card.

Here is my value function:
int CalcHand( CardStack stack )
{
bool hasAce = false;
int handVal = 0;
int numCards = stack.NumCards();

for( int i = 0; i < numCards; i++ )
{
// get the card from the stack
Card temp = stack.Pop();

// get the value of the card, with aces showing up as 1
int val = temp.LoVal();

// check for face cards
if( val > 10 )
val = 10;

// add the value to the hand
handVal += val;

// check if there is an ace in the hand
if( val == 1 )
hasAce = true;
}

// now check if there was an ace
if( hasAce )
{
// save the value
int saved = handVal;

// see if we can fit a high value ace
handVal--;
handVal += 11;

// check if adding that ace as a high value would cause us to bust
if( handVal > 21 )
handVal = saved;

}

// return the value
return handVal;
}



Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!