Results 1 to 2 of 2
  1. #1
    NoobieCode is offline Senior Member
    Join Date
    Mar 2013
    Posts
    123
    Rep Power
    0

    Default how to keep track of someones turn in a general game in Java

    Hi. In a game, like chess, checkers, battleship, etc. How can I keep track of the turn player and the next turn player?

  2. #2
    AndrewM16921 is offline Senior Member
    Join Date
    Jan 2009
    Location
    NJ, USA
    Posts
    263
    Rep Power
    6

    Default Re: how to keep track of someones turn in a general game in Java

    There are a lot of ways to do it. You can have a boolean that is true for Player1's turn, and false for Player2's turn. Or, if you have a Player object in your game, you can have a "Player current;" type of thing, where current holds a reference to the player whose turn it is. Or, if your players are numbered, you can have int current = 0...1...2...etc.

Similar Threads

  1. My First Completed Java Project; Turn Based Strategy Game
    By fatchance30 in forum Reviews / Advertising
    Replies: 1
    Last Post: 06-10-2013, 09:58 AM
  2. General Concept Question For Game Design
    By New_User in forum New To Java
    Replies: 0
    Last Post: 04-03-2012, 03:29 AM
  3. why my car can not turn left and turn 5 round,Help!!THx
    By seongchog in forum Java Applets
    Replies: 7
    Last Post: 03-01-2012, 09:53 AM
  4. Turn based game
    By knightwriter in forum New To Java
    Replies: 7
    Last Post: 12-14-2011, 06:02 PM
  5. JAVA Fast Track Course
    By fortius_computers in forum Reviews / Advertising
    Replies: 0
    Last Post: 08-30-2008, 09:55 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •