This site requires JavaScript, please enable it in your browser!
Greenfoot back

matzaurus's Comments

Back to matzaurus's profile

Yep! The ArrayList would be good. Now I got my head around it :) thanks!
Well the deck doesn't have to remain constant considering a real game of blackjack is played with multiple decks which get shuffled, I might just add more stacks :) cause thats what I used to implement the deck and pick cards randomly from them so in that case you can get the same card in a draw :D. Won't putting them in an array result in a ton of iterations through it even in an ArrayList?. I'll put a bustCheck in the Hit button so it busts you if you go over 21 while hitting rather that when you stand and let the dealer finish drawing his cards.
Thanks for the feedback! I've solved the problem with the same cards showing up so often. It used to rebuild the deck at each new deal because if you ran out of cards from the deck while playing it would give a NullPointer Error but the new version will check every time you take an action if the deck is empty and refresh it. I still haven't figured out how to show the cards after the win/loose message and how to make them float :). I'll keep working on it ... If anyone has any ideas about those two things and wishes to share them with me leave a comment :).
First time using Greenfoot :). Let me know if you find any bugs or have any suggestions. And of course if you like it or not :D