Thread: online game
View Single Post
Old Apr 15th, 2008, 6:38 PM   #1
cwl157
Professional Programmer
 
Join Date: Feb 2005
Posts: 327
Rep Power: 4 cwl157 is on a distinguished road
online game

I completed the battleship game that i was working on and posted that other thread with the question but now i have another question. I have made it 2 player so the players enter their name and where they want to place the ships and everything but i want to make it so 2 people can play each other over the internet. I have done a simple echo server in java but i am still confused if i have multiple classes and stuff how i make the server so in the places where now i would display to the screen i want to display to the 2 clients. Would i have the server end run the main battleship program and then just change the display methods to display the board and moves to the clients connected instead of to the screen? I am confused on how i could do that? Thanks for any input. If i have to post code i will but its like 8 classes basically in the board class I have a printBoard() method that prints the board out so that would have to print to the clients connected and i would have to print the prompts and wait for the response from the clients on where to place ships and where to try and hit the opponents ship.
cwl157 is offline   Reply With Quote