Results 1 to 8 of 8

Thread: Turn based game

  1. #1
    knightwriter is offline Member
    Join Date
    Nov 2011
    Posts
    49
    Rep Power
    0

    Default Turn based game

    I just finished a text based rpg in java and have some time off before school starts up again in January. I have studied the 2d graphics chapter in my java book and am thinking about designing a turn based game, something akin to Sid Meier's Civilization V. Of course nothing as glamorous as that. I want to do something basic that has stats and abilities change with incrementing time.

    My question is if someone can point my in the right direction for researching how to implement turn based features in java? I'm not sure where to start looking.

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default Re: Turn based game

    turn based features in java?
    Just curious, What are "turn based features"?

  3. #3
    knightwriter is offline Member
    Join Date
    Nov 2011
    Posts
    49
    Rep Power
    0

    Default Re: Turn based game

    Sorry if I wasn't clear enough. With the game I'm thinking of making I need to create a way to count time. In this case time equals a turn. For each turn stats and abilities of the player and the players enemies will increase and decrease based upon actions of the player. So right now I'm trying to design the logic of how to increment time. I'm thinking of using a counter to increase time by 1 every time the player hits the next turn button.(The player would hit the next turn button once they have done everything they can or want to do that turn.)
    I'm wondering if there is a better way to design this than using a counter, possibly with a class or method that I'm just not aware of?

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default Re: Turn based game

    Not sure what your goals are. Sounds like a counter would work.
    You can measure clock time with methods in the System class.
    If you want to give a set time to a player, you could use the Timer class.

  5. #5
    knightwriter is offline Member
    Join Date
    Nov 2011
    Posts
    49
    Rep Power
    0

    Default Re: Turn based game

    I would program times when specific events would occur during the game. For example, every three turns a new citizen is born in the players home town; or, if the player decides to build roads at some point in the game, this would then set off the road method that would require the player to spend money on upkeep for the roads every ten turns. Should I read up on the java documents for the System Class, or do you think that my design idea here would work well?

  6. #6
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,562
    Rep Power
    25

    Default Re: Turn based game

    Sorry, I have nothing to say about what you are trying to design.
    The method in the System class I mentioned is a simple way to get the current time.

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,091
    Rep Power
    20

    Default Re: Turn based game

    A game loop.
    Since this is a turn based game, the easiest is simply to say that each time round the loop is a turn.
    During that turn you do all the house keeping.

  8. #8
    knightwriter is offline Member
    Join Date
    Nov 2011
    Posts
    49
    Rep Power
    0

    Default Re: Turn based game

    Thank you Tolls and Norm. This helps clarify my design for this project.

Similar Threads

  1. i need an example of JSR179 ((Location based Ser)implementation for CDC based device
    By talk_to_vivekmishra in forum CDC and Personal Profile
    Replies: 3
    Last Post: 12-30-2010, 10:07 AM
  2. Replies: 2
    Last Post: 08-05-2010, 04:49 AM
  3. creating a text based game
    By Phobos0001 in forum New To Java
    Replies: 1
    Last Post: 02-12-2008, 04:35 PM

Posting Permissions

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