Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Networking a game

  1. #1
    Junior Member
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Networking a game

    We've created a game in my java class, but I'm not sure how to network it together to be able to be 2 player.

    Do we need to create something like a client/server similar to like an IM system?

    How would I implement notify() and wait() methods in to this?

    If someone could help me out or direct me the right way that would be awesome.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Networking a game

    Can you explain in more detail what you are trying to do?
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Apr 2012
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Networking a game

    It's a battle ship game. I want to figure out how to connect 2 players to one game. Also, we want to have it so 1 player can only make 1 turn at a time, I'm guessing I would use notify() wait() for this. So, each player can only take 1 turn, then wait for the other player to take his.

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Networking a game

    You could connect peer-to-peer or use a server for the communications between players. How would one player get the IP address of the other so they could connect?
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Mina networking
    By imsuperman05 in forum Java Networking
    Replies: 5
    Last Post: December 24th, 2011, 01:01 PM
  2. Networking Java
    By aneel in forum JDBC and Database Tutorials
    Replies: 1
    Last Post: December 13th, 2011, 03:28 AM
  3. Game Networking
    By Parsnips in forum Java Networking
    Replies: 15
    Last Post: December 1st, 2011, 02:57 PM
  4. networking in java
    By sridhar in forum Member Introductions
    Replies: 1
    Last Post: October 4th, 2010, 11:11 AM
  5. networking problem
    By anurupr in forum Java Networking
    Replies: 0
    Last Post: March 15th, 2010, 04:26 AM