Wednesday, June 26, 2013

All About Adroid Multiplayer “TONG-ITS” (Filipino Poker Style) Card Game

Tong-its is a three-player knock rummy card game that has become popular in the northern Philippines in recent years. Both the name and the structure of the game suggest a relationship to the American game Tonk. Tong-its appeared in the late 20th century and seems to be an extended version of Tonk, played with 12 card hands.

The object of the game is, by drawing and discarding, to form a sets or run, and to minimize the count of unmatched cards remaining in your hand. A run consists of three or more consecutive cards of the same suit, such as ♠4 ♠5 ♠6 or ♦7 ♦8 ♦9 ♦10 ♦J. (A-K-Q of a suit is not a run since aces are low in this game). A set consist of three or four cards of the same rank, such as ♥7 ♣7 ♦ 7. A card can belong to only one combination at a time – you cannot use the same card as part of both a set and a run. The game ends if one of the following happens; the deck is empty, one of the players won by tong-its (score is zero) or the player wins the game by draw.

Tong-its Card Game is one of the most popular card games in the Philippines. Using this application, one can play Tong-its with their friends anytime and anywhere using the Android mobile devices. Moreover, multiplayer Java games in computers are also very popular. These Java games can be played whether online or offline. The functionality of existing java games is extended to support multiplayer games using Bluetooth connectivity through mobile. In this case, the new java games are more portable. Tong-its multiplayer card game is one of the android application multiplayer games that could utilize Bluetooth connectivity.

Tong-Its is a card game for three players only, using one standard Anglo-American deck of 52 cards (without jokers). The cards in each suit rank Ace 2 3 4 5 6 7 8 9 10 Jack Queen King. An Ace is worth 1 point, 10, Jacks, Queens and Kings are worth 10 points each, and all other cards count their face value.


<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:id="@+id/startUpLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        tools:context=".Main" >

       <ImageView
                android:id="@+id/imageViewStartup"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:background="@drawable/start_up"
                android:scaleType="fitXY" />
        <ProgressBar
                android:id="@+id/progressBar"
                style="?android:attr/progressBarStyleLarge"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_centerInParent="true"
                android:gravity="center" />
</RelativeLayout>

The Start-Up interface as shown image above is written in Extensible Markup Language(XML) in relative layout format with corresponding OnClick functions that need to be clicked to proceed to the next interface which is the main menu interface. The background of the interface is a simple image in Portable Network Graphics(PNG) format. you can email me for the full source code of this simple android Multi-Player Card Game.


Main Menu interface as shown image above is coded in XML along with the different buttons. The background of the interface is an image in PNG format. The OnClick functions of the button are implemented in Java Code.


About Page interface as show image above contains the game icon, game title, and the game developer together with the version of the game. About page interface is coded in XML in relative layout format with a background image in PNG format which contains the information.




Help Page interface as shown image above contains all information about the game, such as how to play the game and the mechanics and rules of the game. Help Page interface consists of ten pages, It is written in Hypertext Markup Language(HTML) format for better display and animation.


Play Menu interface as shown image above shows the menu play's options, i.e. choosing between Single Player or Multi-Player play. Play menu interface consists of buttons coded using XML while the OnClick functions are coded using Java.


Bluetooth Permission Request interface as shown image above automatically pops up when the Bluetooth is in Off State. Bluetooth will have to be turned On in the mobile phone in order to play in MultiPlayer mode.


MultiPlayer Menu interface as shown image above allows the user to choose whether the user would like to host a game by being a server, or join a game created by another user by choosing server or client, respectively. Discoverable allows the user to advertise the Bluetooth device to make the device discoverable to clients who would like to join the game.


When there are no other Bluetooth capable devices in the vicinity, the game can still be played in single player. A Single Player Game as shown image above allows the user to play against the artificial intelligent(AI) players. The AI players are designed to serve as opponents for a Single Player Game.


If the user wants to be a server for a game, the user will have to wait until a client has discovered the device. The user will be prompted with an image which will continue to loop while waiting for a client to connect as shown image above. The user will also be notified once a client has connected or joined the game.



If a user wants to join a game that has been created, the user must scan for available Bluetooth connection to connect to the server as shown image above. When the client successfully connects to the server, the Tong-Its game will start.


When a Bluetooth connection is successful between two phones, the Tong-Its game will start. The server, who hosted the game, is automatically dealt with 13 cards and is obliged to throw a card to the discarded pile of cards to officially start of the game, as shown image above.


At the beginning of the game, the client or the player 2 will be holding 12 cards and waits for the server to throw a card to the discarded pile of cards so that the client can counter. The client side start of the game as shown image above.


Clicking a Card : When a user clicks a card, the chosen card is elevated or put on top over the other cards on hand.

Sorting a Card by Rank : By Clicking this icon or image as shown image above, it enables the user to arrange the cards by Rank from Aces to Kings.

Sorting a Card by Suit : By clicking this icon or image as shown image above, it enables the user to arrange the cards by their respective Suits.

Draw a Card : By clicking a Draw icon or image as shown image above, the card will be added into the Player's hand. After a card is drawn, the icon or image will automatically be disabled by showing a red X mark on it as only one card may be drawn.

Drop and Chow : Selecting a card from the hand and clicking on the discarded pile will drop the card. Clicking the discarded card pile without selecting a card from the hand is a Chow. When a user chows, the card will be reflected automatically to the meld area or the combination area wherein you have to throw valid cards to achieve a meld to proceed. If the card was drawn by mistake, the user may cancel the draw. When a user tries to throw a card that does not have a valid meld or combination, all the cards returns to the user hand. The different operations are shown image above.

Call Draw or "LABAN" is challenging the user's opponent to accept the challenge. In this challenge, whoever has the lower score will win the game. The score is the SUM of all the values of the cards in the user's hand. When the user challenge their opponent, if the opponent did not throw at least one meld, then the opponent will automatically lose the game. This is called "BURNED" or "SUNOG" as shown image bellow.


When a winner has been determined, either by Tong-Its or by default, the player are notified and the game ends as shown image bellow.


When a User or Player Lose the Game, the Player are notified and the game ends as shown image bellow.



Good morning guys, by the way I'm currently using Aptana Studio 3 IDE for Android and Mobile Web Application. you can also develop Ruby Projects and Rails Project etc. using Aptana Studio 3. Here is the link so that you can download and install Aptana Studio 3. Enjoy coding, have a good Day...



Hi Guy's, I have something updates for this project and the IDE that I currently using right now. I choose to used Android Studio for this kind of stuff mobile development specially on Android Application. By the way, its better to develop an application in Linux environment guys based on my experience as a developer. here's the link on how to install Android Studio via PPA on Ubuntu or Linux Mint. Enjoy Coding Guy's, have a good day.

19 comments:

  1. Hello guys, I'm currently developing the game to make it compatible to any android devices. Thanks for viewing guys...

    ReplyDelete
    Replies
    1. Hello Can you send me the source code for this project. Im new to android. And i look forward to gain more knowledge about multi player games via android and Im planning to develop the Gofish game the way you did with this game. I sincerely hope you can help me out :)

      Delete
    2. Any link to download this game?

      Delete
  2. Hi Guys, Good Morning...

    Guys if You have a bit of interest regarding of this Blog which I created feel free to contact me or email me then we can talk for that... email me @ redwolfgang20@gmail.com.

    Have a Good Day Guys... :)

    ReplyDelete
  3. Good Day Sir, We have the same System. Exactly!
    Sir if it's not too much requesting, can i request for the source code of your system? We need the source code for bluetooth enabling and Artificial Intelligence (if it is on Single-Mode as a player) We sincerely hope you can lend a hand for us.

    Here's my email sir, imkaelofficial@gmail.com
    and also my FB Account. https://www.facebook.com/imkaelofficial

    THANK YOU VERY MUCH! GOD BLESS!

    ReplyDelete
    Replies
    1. You can find me On facebook... add me then we can talk about it. maybe I'm going to discussed how it works technically...

      Delete
    2. Good Day Sir, I just sent a private message on your facebook account.
      https://www.facebook.com/redwolfgang20
      Please comply if read. Thank you very much!

      Delete
    3. Sir, what is your facebook account so?
      I think I just sent a message to a wrong account. TIA!

      Delete
    4. Add me here in G+ then send me a message through Hangouts.. I can't flag my fb account here...

      Delete
  4. Your blog is definitely worth a read if anyone comes across it. Im lucky I did because now Ive got a whole new view of this game. I like games like online poker its an interesting & skilled based game.

    ReplyDelete
  5. Poker is a big source of entertainment either it is online or the other way.It is very popular game in whole world.I like online Poker games.Thanks for the post.

    ReplyDelete
  6. May I please get the source code for this game so I can learn the mechanics of Bluetooth multiplayer? My email is
    michaelpsasscer@gmail.com

    I would GREATLY appreciate it!Thanks!

    ReplyDelete
  7. Festival Poker 2019 P'O'K'E'R V`1`T`A adalah situs dengan berbagai jenis permainan online yang membawa hiburan dan kesenangan bersama. Menyediakan berbagai permainan yang dapat dimainkan dalam 1 user ID :

    *ADU Q
    *BANDAR POKER
    *BANDAR Q
    *CAPSA SUSUN
    *DOMINO 99
    *POKER ONLINE
    *SAKONG
    *BANDAR 66 (NEW)

    Fasilitas yang ditawarkan untuk para penggemar judi online adalah :
    * Minimal Deposit : 10.000
    * Minimal Withdraw : 25.000
    * Deposit dan Withdraw 24 jam Non stop ( Kecuali Bank offline / gangguan )
    * Bonus REFFERAL 15% Seumur hidup tanpa syarat
    * Bonus CashBack 0.3%

    Contact us :
    WA: 0812.2222.996
    BBM : PKRVITA1 (HURUF BESAR)
    Wechat: pokervitaofficial
    Line: vitapoker

    ReplyDelete
  8. Best Android Card Games: 10 Best Card Games for Android Reviewed https://appstalkers.com/

    ReplyDelete
  9. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. Great work. bandarqq

    ReplyDelete
  10. This is truly insightful! I love how clear and actionable your explanations are—it really simplifies putting these tips into practice.
    Rummy game development company

    ReplyDelete