Reputation: 57
I have a game - Asteroids - that is currently only a single player game. What I want to do is to have 2 players be able to play at the same time by competing in how many Asteroids they can shoot. Rather then each taking turns, I want them both to compete against each other in the same game session. The code I am using for the Asteroids game is taken from here: http://mikemiller.net/asteroids/Asteroids.java
Its much too long to post in full - over 1000 loc - but I want to make this game into a 2 player game over a network. Does anyone have any tips or advice on how to do so? I have read elsewhere that RMI would be a good choice for this game, if anyone has any advice for that I would appreciate it.
Thanks.
Upvotes: 0
Views: 1164
Reputation: 4574
Using simple client-server socket architecture could do what you need. The server part would keep the game state : accept updates from each client, and make them aware of such changes. The clients would send the updates to server (eg player moves) and accept the updated game state from server, and update/draw the GUI/screen accordingly
Upvotes: 1