whiteSkar / Blackjack_VR

An experimental Cardboard VR Blackjack game to see how it's like making a game in VR
https://play.google.com/store/apps/details?id=com.DoomChitGames.BlackjackVR
0 stars 1 forks source link

Random card repeat #1

Open futer24 opened 8 years ago

futer24 commented 8 years ago

Hi

There's a problem in DeckController.cs using only the Random.Range() method; It could be the same card twice. You need to shuffle card in each round:

void Shuffle () { for (int i = 0; i < cards.Length; i++) { GameObject temp = cards[i]; int randomIndex = Random.Range(0, cards.Length); cards[i] = cards[randomIndex]; cards[randomIndex] = temp; } }

Thanks for the code and good work!

whiteSkar commented 8 years ago

Hi futer24.

Thank you very much for your input!

I did thought of shuffling the cards but I assumed this casino will have infinite number of decks in the deck to prevent card counting.

Usually, casinos have 6 decks on one table. So I think it is normal to have the same card several times. The only difference is that this game has infinite number of decks instead of 6 decks. :)