Card Lib

Blitz3D Forums/Blitz3D Userlibs/Card Lib

Rook Zimbabwe(Posted 2004) [#1]
Anyone know of a good Card Games Library for B3D?
RZ


Rook Zimbabwe(Posted 2004) [#2]
OK so that's a no???


wizzlefish(Posted 2004) [#3]
You remind me of me. :P

What do you mean by "Card Games Library?"


Rook Zimbabwe(Posted 2004) [#4]
You know... something that would make it easier to write casino or card games... VB had a CARDS.DLL that used the windows decks and could tell the value of the card and the name of the card and the suite of a card etc. All good for creating a card game. I have tried to use it in Blitz but it refuses to work.

RZ


Dustin(Posted 2004) [#5]
I'll put you on the right track...

There's 52 cards in the deck and let's suppose the following
1-13 = SPADES A,2,3...J,Q,K
14-26 = CLUBS A,2,3...J,Q,K
27-39 = HEARTS A,2,3...J,Q,K
40-52 = DIAM. A,2,3...J,Q,K

You find the suit by comparison: card 32 = HEART, card 5 = SPADE. You find the value by subtracting 13 from it until it's value is 13 or less:
So, CARD 48 (- 13 - 13 - 13 = 9) is the 9 of Diamonds.
Now run with it!


Rook Zimbabwe(Posted 2005) [#6]
You know Dustin that a lot of good info... I never even thought about the subtract 13 thingee... Now does anyone have any ideas about how to create a card deck that won't hog system resources? Sprites? Mesh?
RZ


WolRon(Posted 2005) [#7]
And the MOD 13 command does it for you...


Snarkbait(Posted 2005) [#8]
Rook -- you still need this? I'm working on a cards.dll (the dll that comes standard for windows and is used by Solitaire, etc. ) userlib... works great so far with Blitz+ but kinda wonky on B3d unless someone knows how to draw from an API call directly to the DX backbuffer()

Here's a sample of a quick BlackJack I'm making with it:


added to code archives:
http://www.blitzbasic.com/codearcs/codearcs.php?code=1381


Rook Zimbabwe(Posted 2005) [#9]
yes, I do still need it... did you finish it?


Snarkbait(Posted 2005) [#10]
Yup, the cardlib works well, check the archive entry.
http://www.blitzbasic.com/codearcs/codearcs.php?code=1381

Still, however, it is way easier to use with b+ than with b3d. Check my blackjack game source if you want to see how I use it.
http://www.codersworkshop.com/viewshowcase.php?id=177