1 / 21

ECE 491 Final Project Multiplayer Card Game

ECE 491 Final Project Multiplayer Card Game. Author: Tian Ma Presentation 5/4/2004. Project Goals. The goals for this project is to demonstrate, experience, and explore all aspects of Java Internet Programming This project will concentrate on three main areas of Java

ryder-watts
Download Presentation

ECE 491 Final Project Multiplayer Card Game

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ECE 491 Final ProjectMultiplayer Card Game Author: Tian Ma Presentation 5/4/2004

  2. Project Goals • The goals for this project is to demonstrate, experience, and explore all aspects of Java Internet Programming This project will concentrate on three main areas of Java • Java communications (Sockets) • Graphical User Interface (GUI) • Object Oriented Implementation • Other Advance Features

  3. Problem Statement • In today’s world, many people would like to play games with 2 or more persons rather than playing with boring computers. However, to have people gather in one place to start a game is not always a suitable solution. Finding partners might not be easy.

  4. Solution • This project, I implemented a multiplayer card game to allow players to play a card game across Internet so people will not need to worry about finding partners and gather people in one location to play the game. • With an Internet connection, they can play the game with people all over the world.

  5. Tools • Pure Java Language • J2SE 1.4 compiler • Local host server • In this project I installed the Internet Information Service (IIS) that comes in with the original Windows XP Professional CD and use it as a local host server

  6. Main Features of this Application • A public chat room: allows people to communicate with people all over the world. • 10 private game rooms: maximum of 10 groups of people can be play simultaneous in the server. • Game Play Flexibility: The game can be play anyway between 2 to 4 persons (4 is the best), in case you don’t have four. • Chatting within game room: players can communicate with their own group while in the game room playing the game. Communications in the private rooms are restricted and not open to the public. • User friendly GUI with graphics: graphics and images are added for better visualization and buttons and text fields are created for ease of use.

  7. Game Introduction • The card game that I implemented is pronounce as “Da Lao Er” in Chinese, or translated in English as Big 2, or pronounce as “Daifugo” in Japanese, or translated in English as Big rich. This is a very popular card game in Asia. • Why “Da Lao Er” ? Well, this the only card game that I enjoy playing and play well. • Whatever name you want to called it, all we care is how to play? There are so many rules of playing it. So I will have my own rules too. These are the rules that I normally playing with my friends

  8. Game Objective • The objective of the game is to be the first one to get rid of all of your cards by playing them. Cards can be played single or in certain playable combinations. The first person who get rid of all the cards wins, while others score penalty points. • This Game can be play by 2 – 4 players (4 players is the best).

  9. Playing the game • The player who holds a diamond 3 (or the smallest card if less than 4 player) will begins and must play this card, either by itself or as part of a playable combination. The person to this player's right plays next, and follows the counter clockwise direction. • At your turn you must either pass (play no cards) or beat the previous play by playing a higher combination of the same number of cards. Single card must be beat by single card, pairs must be beat by pairs, triples must be beat by triples, and 5 cards must beat 5 cards. This continues for several rounds if necessary, until all but one of the players pass in succession, or no one being able or willing to beat the last play. The person who played highest (all the others having passed) wins the turn and begins again by playing any card or legal combination of cards. • You are never under any obligation to beat a card or set of cards just because you are able to - you may always choose to pass and keep your high cards for a better opportunity. Passing does not prevent you from playing when your turn comes round again.

  10. Card Ranking Card Ranking: • The ranking of the cards from smallest to largest are the following: • 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < Jack < Queen < King < Ace < 2 Suits Ranking • for the card have the same number the rank will define by the Suit • diamonds<clubs<hearts<spades • Notations: • d – diamond • c – club • h – hearts • s - spades

  11. Playable Combinations Single card • The ranking of the single cards from smallest to largest are the following: • 3 < 4 < 5 < 6 < 7 < 8 < 9 < 10 < Jack < Queen < King < Ace < 2 • for the card have the same number, the rank will define by a Suit • diamonds<clubs<hearts<spades • For example, a 3d < heart 3h 2 cards (Pairs) • A pair of cards who have the same number (faces). • For example, a pair of 2s, pair of Jacks. • The rank is determine by the rank of the cards. • If the two pairs have the same number, their rank will be determine by their suits. • For example, (jack d, jack h) < (jack c and jack s) 3 cards (Triples) • Three cards of the same number. • 3 Aces, 3 tens, etc.

  12. Playable Combinations cont. 5 cards Ranking: Straights<Flush<Full House<Four of a kind<Straight Flush • A Straight consists of five cards of consecutive rank with mixed suits. A straight with higher ranks beats a lower one, irrespective of the suits of the cards. When the ranks are the same, the suit of the largest card determines which is higher. • For example, 3d 4c 5d 6c 7d < 3c 4d 5c 6d 7s, since 7d<7s • A Flush consists of any five cards of the same suit. A flush in a higher suit beats a flush in a lower suit, irrespective of the ranks of the cards. Between two flushes in the same suit, the one with the largest card determines the rank of a flush. • For example, 3d 5d 6d 7d 8d < 3d 6d 8d 9d 10d, since 8d<10d

  13. Playable Combinations cont. • A Full House consists of three cards of the same number and a pairs; between two full houses, the one whose triple is of higher rank is better. • For example, 5d 5c 5s 6d 6d < 8d 8c 8h 3c 3s • Four of a kind (or quads) are made up of all four cards of the same number, plus any fifth card. The fifth card must be included - four equal cards by themselves are not a playable combination. Between two fours of a kind, the rank of the four cards determines which is higher. • A Straight Flush consists of five consecutive cards of the same suit, twos ranking below threes and aces ranking high or low, as in straights. The rank of the highest card determines which of two straight flushes is higher; between two equal ranked straight flushes, the one in the higher suit is better • For example, 3d 4d 5d 6d 7d<3h 4h 5h 6h 7h

  14. Scores • Scores: • The players other than the winner score penalty points for the cards remaining in their hands. • If you have: • 1 - 7 cards, one penalty point for each cards • 8 – 9 cards, 2 points per card, total of 16, 18 points respectably • 10 – 12 cards, 3 points per card cards, total of 30 33, 36 respectably • 13 cards 4 points per card, total of 52 points, because you never played any cards at all. The winner, having no cards, gets no penalty points for the hand.

  15. Program Demo

  16. Display Design Documents • Display and explain the GUI Flow Chart

  17. Display Architecture Documents • The overall architecture is pretty much self-explanatory. Double arrow indicate bidirectional dependencies (dependent in both way). One arrow denotes single dependency. Instead of each of the classes I will explain some key classes since you can find all the explanations in the documentations. ). The game class basically implements the game. One can see there are many class associated with game. The TestServer class runs the server. The TestApplet.html is use for people to accessing the server. The client engine handle all the actions execute by the client (e.g. chat, enter game room, play cards, etc…). The server engine handle all the actions execute by the server. The client server connection connects the client engine and server engine through server interface and client interface respectfully. From the diagram above, first the clients access the TestApplet it will lead him to enter the entrance GUI, the action listener will sends actions to the Client Engine and the client engine will sends action to the client interface and so on following the diagram until the server gets it. After the server get the actions, it interpret what action to be taken (command interpreter), then perform the necessary tasks in the engine. If all goes well, players are connected and proceed to MainRoom GUI. The MainRoom GUI basically follows the same principles as it implements listeners and sends actions to the client engine, so as other GUI (e.g. game gui commands). So basically, the flow of the program is behave having a GUI listens the command sends to Client Engine and Client Engine performs all the actions.

  18. Hours Spend

  19. Conclusion This multi-player card game project have demonstrated important aspects of Java Internet and especially how how people communicate through the internet using Java. This project is highly related to what we learned in our class. It capture almost every topics we have covered such as: GUI programming, Networking, Applets, Inheritance, and more. The game “Da Lao Er” is a card game that I really enjoy playing. Since my implementation is done in an Object Oriented way, it can be extended to play other card games as well with no hardship. Although this project took me 112 hours to complete, I truly enjoyed the entire process, except for debugging! This project enhanced my skills in Java and it built-up my confidence on what I can do with Java. Furthermore, it has demonstrated my thorough understanding of Java Internet programming and my ability to develop Java Internet application.

  20. Questions & Answers

  21. Thank you all for your time. End of Presentation

More Related