I'm attempting to code a poker game, but I'm not sure where to start. I know I should have a var for the rank and suit of each card, which will be stored in a variable for that card, which in turn is stored in a variable for the hand of that player.
However, I don't know how to go about checking for a pair, or a straight. I would want the code to check for multiple matching vars, and also vars in sequential order. I'm not sure how to do that...
hey remember when you build it that somebody has to deal ...and if that person leaves then the games ends....however you can program flash media server2 to have a server side script which deals even if a player leaves the virtual table.
Well, for now I'm just going for a single player poker game to perfect that coding, likely video poker or something. (maybe strip poker to send to friends maybe)
i made you this but it dosen't load the images on each card properly , though it still might help, each card has a suit and number value, and i have it displaying 5 of the cards at random right now.
Poker is a pretty in depth project if your a beginning actionscripter. Dealing the cards is actually pretty easy. You can use a single card back to deal to mulitple players. The only cards that need to be viewed are the current players cards until after the hand is played. The attachMovie method works well for dealing cards.
A project like this will be very heavy in the use of arrays, for loops, and if statements. You will need to create a scoring system to rank individual hands as well as individual cards. Here is the evaluate function I use in the poker engine demo in my sig....
The above evaluate function was very difficult to figure out and still has a bug. If two hands tie, the last one dealt wins. I havn't had time to mess with it in quite awhile. If your new to Flash and Actionscript, I suggest exploring some easier projects before tackleing this monster