Two Player game

Hi,
I am working on this game where ther are two players. I am not sure how to handle the turns for each player. Can anyone suggest a good way of actually implementing the game so that while player 1 is playing player two is waiting and once finished player 2 can play and player 1 has to wait.
Thanks!

Well, the game is played in JFrame with buttons.
Player 1 is automatic
Player 2 is controlled by user using mousetry something like this
class Games
  int whosTurn = 0;
  boolean gameOver = false;
  public Games()
    while(!gameOver)
      if(whosTurn % 2 == 0) playerTurn();
      else computerTurn();
      whosTurn++;
      if(whosTurn == 15) gameOver = true;
    System.exit(0);
  public void playerTurn(){System.out.println("player played");}
  public void computerTurn(){System.out.println("computer played");}
  public static void main(String[] args){new Games();}
}

Similar Messages

  • Can you play a 2 player game with 2 bluetooth devices on an iPad? Will it support it?

    I'm looking to play some two player games, but wondering if it's possible to hook up a bluetooth controller instead of using an iPhone or something as a controller.
    Thanks!

    That woud be entirely dependant on the game rather than the iPad.
    If the game supports any kind of external input device or not via bluetooth.

  • Yahoo fantasy sports player game notes are no longer visible

    I use yahoo fantasy sports, and have used firefox browsers for the last two years, as of last thursday (12/20/12) my player game notes are not showing up. The link is there but it is not visible. I checked on IE9 and they are fine. The only changes on my system during that time, I had installed Adobe Photoshop elements 11 and then uninstalled it. Please help me fix this or I will have to use IE9 from now on because i need to see those notes. I love Firefox and do not wish to change.

    Be careful with using the same profile with different Firefox versions
    * http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows
    * http://kb.mozillazine.org/Using_multiple_profiles_-_Firefox
    Create a new profile as a test to check if your current profile is causing the problems.
    See "Creating a profile":
    *https://support.mozilla.org/kb/profile-manager-create-and-remove-firefox-profiles
    *http://kb.mozillazine.org/Standard_diagnostic_-_Firefox#Profile_issues
    If the new profile works then you can transfer some files from an existing profile to the new profile, but be careful not to copy corrupted files.
    *http://kb.mozillazine.org/Transferring_data_to_a_new_profile_-_Firefox
    There may be extensions and plugins installed by default in a new profile, so check that in "Tools > Add-ons > Extensions & Plugins" in case there are still problems.
    You can also try to reset Firefox:
    *https://support.mozilla.org/kb/Basic+Troubleshooting

  • I download two free games from itunes, it is not showing up on my iphone. Help

    I downloaded two free games from itunes, it is not showing up on my iphone as an icon.  I see it when i have my phone linked to the computer,

    I think I may have confused you and I apologize. But you are also confusing me now.
    If you were not using restrictions before, then that is why the Allowed Content for Movies in in accessible. You can only access that if you had set a restrictions Passcode. If you do not have restrictions set, then it is a non issue and don't worry about that suggestion.
    Were you actively using restrictions on the iPad? If you weren't then you don't have to enable it now. That will not do any good.

  • Can you pay 2 player games over a wifi network between 2 ipad 2's

    can i play an app game over a wifi network with another ipad user, to save having to pass the device between players

    can yo recommend any 2 player games in which i can play over the wifi network

  • How to transfer app data between two different game center accounts?

    Hello, I really need some help.
    I have looked all over the web for ways to transfer apps between two different game center accounts and different devices. Several weeks ago I started playing Campus Life on my relative's Ipad 2, therefore spending many long hours to get to this point in the game.
    The problem is I just got an Iphone 5 and I really would like to transfer the data onto it, so that I would not need to start all over again.
    My grandma has an account (Game Center) onto which the data has been saved and I would like to have it stored onto mine. On some forum someone said to sign into the account which has the data on both devices and to then open up the game on the new device. It worked. Then I signed out and logged in with my own account- the game started from scratch. I panicked. I went back on the other account, and the data reappeared. I have been going back and forth, the game changing as many times. I thought it would ask to back up my grandma's data on mine but I was wrong. I can not seem to save the game onto my new account, and I have even tried to back it up to Itunes and then copy it onto my phone after having signed into my own account. And I don't know how to properly use Icloud. I am a mess. I am completely lost and have found no help on the web. (All people seem to have to deal with is sharing Apple IDs with different Game Center Accounts for the kids and transferring apps from one of their devices to another.)
    I am so worried I am going to mess up and will lose the whole thing completely.
    I have just started another game with my own account but since I am using my grandma's, the data is erased. It's one or the other but I definitely prefer saving Campus Life. I do not like the idea of having to only pick one.
    I do not know any technical terms, so if you understand or even have the slightest clue about what I am talking about, I applaud you.
    This seems like mission impossible, so if anyone can help in any way, I would be really grateful. 
    Thanks in advance for your time and thoughts!

    I meant to press on "This solved my question"... Sorry if you needed the points.
    Thank-you and I will just go back and forth between the accounts.

  • When I updated to IOS5 I lost two in game app purchases (the mighty eagle), how do I get those back, when I updated to IOS5 I lost two in game app purchases (the mighty eagle), how do I get those back

    when I updated to IOS5 I lost two in game app purchases (the mighty eagle for angry birds and angry birds seasons), how do I get those back? They are not in my app purchased list in Itunes. 

    Contact iTunes Store support staff through the report a problem links in your account history or,
    iTunes Customer Service Contact - http://www.apple.com/support/itunes/contact.html > Get iTunes support via Express Lane > iTunes > iTunes Store

  • Flash player games, video, or audio don't work / Windows

    I have been having issues with my flash player for about a week. I tried all the trouble shooting steps under flash player games, video, or audio, but the issue kept occurring. I successfully uninstalled the flash player, then reinstalled it, the issue keeps occurring, so I followed the trouble shooting steps again, and it keeps occuring. For example, I will be watching a video, then it will spontaneously restart, jump to the end, image distortion, or freeze and the flash player stops responding et cetera. I think it might be what is causing an update error on a game that I play as well, where the game launcher is unable to decrypt and deserialize the download content from the server, or maybe something else is causing the flash player, and the game launcher to have these issues. Hopefully someone has some useful tips to resolve this issue that I haven't tried yet. Thank you for your time.

    I myself have a problem with firefox after installing this no videos run etc

  • How can i have same billing account with two different game center accounts

    I Need two different game centeraccounts on two different devices thatshare same apple id

    I looked at this post last night and assumed that the OP had decided he did not have a question; however, since you decided to post......
    Mac or iDevice, is forever 'connected' with the AppleID
    actually, that is not correct. It can be wiped and disassociated; it is any OS or app obtained at the app store which is tethered to the Apple ID used to obtain it, not the hardware. See the SLA.
    If a device was tethered forever, it could never be re-sold - obviously.
    As for the OP's question: I am not sure as I could not find any reference in the legal documents available, but I believe it is not possible - one Apple ID = one account.

  • Translate written words on flash player games

    Question for anyone out there that has any suggestions or advice.  My problem is I speak English but I have a few gaming sites that are french.  The translator translates everything on the page accept for the written words that are included in the flash player game (Hope that makes sense.)  I really like these game sites but a lot of the time I don't understand what I'm doing and/or what I'm winning/losing.  It's very annoying so my question is..... Is there any way to translate French to English on games that use Flash Player? 

    ANY and ALL text in a Flash container is INSIDE the container and cannot be translated with plug-ins. The reason is that the content of a Flash container is NOT text and is NOT HTML.

  • Can't open Ipod,DVD player,games. When I select something from my desktop

    when I select Ipod,DVD player or previously installed games from my desktop they appear in the dock for a second or two and then disappear. Followed by the " cancel, retry or report message. I have owned this eMAC for about four years with no problems.

    Boot in Safe Mode. See What is Safe Boot, Safe Mode? (Mac OS X)
    http://docs.info.apple.com/article.html?artnum=107392 Takes a while to run, but it usually "fixes" problems.
    Have you repaired permissions?
     Cheers, Tom

  • Can two separate Game Center users share the same Apple ID?

    Two people share the same Apple ID on their separate iPads. Now want to start getting into games and compete with Achivements. Can they have separate Game Center accounts using the same Apple ID?
    (similar to how they use the same Apple ID with FaceTime, but are able to use different email addresses for video calls)

    Creating a new iTunes account does not remove any purchases made on a different account.
    If you want to create a new account : iTunes: How to set up an Apple ID within iTunes
    Or if you will want to use it in the stores and don't want to give credit card details : Create an iTunes Store, App Store, or iBooks Store account without a credit card or other payment method
    Or if you are not currently logged into an account in game centre then you should have a 'create a new Apple id' link at the bottom of the login screen in it.

  • Two new games for the lumia 521

    Two games you guys should try to add to the Nokia Lumia 521 is minecraft pocket edition and call of duty black ops zombies they have these games on apple and android products and I think you guys should try to add them to the Lumia 521

    Hi joshua0726,
    Welcome to the forum!  
    The availability of apps in the Windows Phone Store depends on the app developers themselves. They're the best teams to ask if they have plans to make their apps available for Lumia WP8, particularly with the Lumia 520. 
    You may also submit apps and feature suggestions at this website: windowsphone.uservoice.com.
    Let us know if you need further help. 

  • How can i use 2 mice on my mac - so kids can play 2 player games at once?

    How can I set up 2 mice on my Mac - so kids can play a 2 player computer game together?

    Time Star is PC based software and is designed to run in MS Windows. You can run MS Windows on your MBP however you will at a minimum need a license of MS Windows check with the Time Star manufacturer to see what version of WIndows you will need. Assuming it can run on Windows 7 you have many choices including:
    Run Boot Camp, this is the least expensive way however it means  you cannot simultaneously run OS X. Boot Camp is free and is pre-installed on you MBP.
    The next option is to run emulation software such as Parallels or Fusion. For this type of app this is the strategy I'd recommend if you must run Time Star because it allows one to simultaneously operate Windows and OS X.
    However when you run MS Windows on a Mac in either emulation or Boot Camp that portion of the Mac is susceptible to all the issues PC's have such as viruses and other malware so you need to take  proper precautions.
    My recommendation would be to search to see if there is either a OS X version of Time Star (contact the manufacturer) or start looking for a replacement app that is designed to run in OS X.
    Roger

  • 2-Player Game Via Internet

    I want to design a simple turn-based game using an applet on a Web page, in which two users on different computers can play against each other.
    Can anyone give me any pointers on how to allow two users to interact within the same instance of such an applet? Eg, how they can both connect to a game involving each other, and how the program can refer to them uniquely (eg, identifying whose turn it is, and passing control to that user).
    I can make the game work for two players using the same computer, but I haven't the first idea about creating online multiplayer functionality. So any help at all would be valuable and much appreciated!

    what jboeing says is right.
    and writing one is fairly simple, i wrote a simple chat room program in a couple of days which was quite handy....a good book to look in is "the black art of java programming" although i think this book is fairly out of date considering i bought it about 2-3 years ago, lol.
    the problem im having is that although the program runs fine locally, im having troubles getting it to run on my web server..its a bugger i tell you

Maybe you are looking for

  • How to disaply multiple column of a table in a single flex datagrid column

    Hi, I have a table in my database which has say 3 column (Firstname,LastName,Location). I wanted to display these 3 different values in a single column in flex datagrid. Could you please help me out in this Thanks, Pratik

  • My Ipod crashed and I can't restore it.

    When I try and restore it, it says I need to update my firmware but when I go to install the firmware it extracts but then I get an error message. It won't let me update to 5.0 or any earlier firmware. Help!!

  • Oracle SQL Developer - TNS

    Hi. Before installing Oracle 11g, Microsoft Loopback adapter installed. During the installation I did not have any errors, but I can not connect to database XE tnsnames.ora: XE = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.101)(PORT =

  • How to partition HD in order to load the rescue and recovery backup

    HI All, Can anyone tell me how to properly partition the HD in order for the Blue Button(thinkVantage) to work again? Does it matter in the order how you create the partition...? (I create one partition then separate them via Partition Manager) I loa

  • Other Ways to secure Adobe Forms

    Hi, Digital Signature can be used to secure Adobe Forms. Is there any other option to secure the Adobe Forms like using EMail Digital Signature etc.. Regards, S.V.Satish Kumar