This will be my first program in C++ and it will be a crap game with every possible bet, just like on a Vegas crap table. I'm using SFML to display half of a crap table and to display the bets (chips) for up to 4 players on the crap table.
Every bet will be positioned in the proper place in each bet box just like on a Vegas crap table. This means there will be 4 positions on the passline (for 4 players), 4 positions for passline backup bets, 4 positions for each "place bet", etc.
To give you an idea of what I need, here's some sample bets in a struct:
1. When displaying the chips on the table using SFML, I need to scan all of the "betAmount" values. If zero, don't display. If greater than zero, display the proper amount of chips at the coordinates given.
2. When a player makes a bet, I need to update "betAmount" easily.
3. When a player loses a bet, I need to zero "betAmount" easily.
1. To display the bets (chips) on the table, I need a for loop to scan every bet position to see if the "betAmount" is greater than zero. But the way I showed the code above does not seem to be a good way to do that.
2. When a player clicks in a bet box to make a bet, I need to translate the mouse coordinates to know which bet box was clicked in, and then update the "betAmount" for that player.
Any suggestions on how to store all of the bet info that will allow easy updating of the "betAmount" when bets are made or lost, and yet allow scanning with a for loop to display the bets made.
Last edited by raptor88; September 26th, 2012 at 03:18 PM.