Sign in to follow this  
cptrnet

Card Game Help

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
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this