Design and implement a 2-person "WAR" card game with a NICE GUI. Or the best of your ability

Requirements:

  • This game will have TWO players.
  • There are 52 cards in a card deck (I have attached the pictures/images for each card). Use the "ImageIcon" class to create a JLabel with a picture on it. I will give you some sample code in class for how to do this with pictures. Google it as well and you will find plenty of sample code . Essentially, create a JFrame with a JPanel in it (maybe more than one JPanel if you want to organize your screen with buttons in 1 panel and cards in another panel and then maybe even a menu in a third panel). Inside of your panels, you will put your graphics objects (JButton, JLabel,…) . For this game, create a JLabel (at least 2 of them for the cards that are on the screen for each user). Inside of the JLabel will be an “ImageIcon” (with the picture of a card … use the .png files … c2.png, c2.png, ….)
  • To begin play, each player gets ½ of the deck (26 cards each). Make sure you RANDOMLY select which cards you give them. (Hint: ((int)(Math.random() *52)+1 will give you a random number between 1 and 52 . Assign each card in the deck a number between 1 and 52).
  • During each ROUND, each player will show their top card and will compare them. The player with the high card will “win” the other player’s card. NOTE: IF THERE IS A TIE (the players display the SAME card value), then you must play “war” … spell out W-A-R …put down 3 cards in a row and then draw the final card to see who wins the “war”. This tie-breaking activity continues until someone wins the “war”.
  • Each player should have 2 PILES (or arraylists) …. One with their current playing cards (“CURRENT” pile!) and the other with the cards they won during their “face-offs” (“WINNINGS” pile!) …When the player has no more cards in his current playing deck, then he must “SHUFFLE” (come up with your own method of “randomizing” the cards … maybe shift every other card to another spot in the deck so that they are not in order anymore) his “winnings” deck and use that pile as his “CURRENT” deck.
  • Play will continue until one of the players has no more cards left. The player with NO cards left is the LOSER.
  • Make sure you give your program an appealing GUI.
  • COMMENT your code so I know what each section of your code is doing.
Academic Honesty!
It is not our intention to break the school's academic policy. Projects posted are only used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly fill out the form. Please provide a valid email address and we'll get back to you in less than 24 hours. We will be sending an invoice through PayPal upon confirmation. We are a non profit organization however we need an amount to keep this organization running, and to be able to complete our research and development.