[quote]Hi, I am new to java programming, but I was wondering if there would be some (potentially easy) way to convert a game which is multiplayer on the same computer into a game which could be played between two computers? The game I have in mind is slime volleyball, which can be seen here:
http://www.fetchfido.co.uk/games/slime/slime_volley_ball_game2.htm
How would I go about turning this into a network game? Thank you for any help or advice you can give me.
[/quote]
I don’t know how the game handles it’s player input, but here’s how I’d go about it. I’d remove the player i/o into a separate component. Then I’d hide it behind an abstraction layer. Sort of a “black box” operating through an interface. Then after it works fine, I’d modify the component hiding behind the interface. Only one player’s input is read from local device. The other player’s input is received from a network socket. Then the local player’s input is sent to the socket. As long as you can stay “black boxed” behind the interface, you don’t have to touch the game code. Hopefully! :
Of course it’s not as simple as that but you’ll figure it out when you’re doing it. First step is to completely remove the keyb/mouse/pad reading from the actual game and hide it behind an interface.