Global Positioning System Reference
In-Depth Information
1. Open the file RandomPlayer.java with a text editor (not in the IDE
yet).
2. Copy the content into a new file (does not need to be saved).
3. Replace all RandomPlayer Strings with AIRunner .
4. Open
the
IDE
and
create
a
new
class roa.ldn.client.players
.AIRunner
5. Copy the modified file content into the new class and save.
6. Save the file ../resources/london.roa/client/RandomPlayer.props
as AIRunner.props and add it to the command line to launch AIRunner .
7. Modify the main method to playerFactory(1,0) as an example.
8. Run a game with the new player (and other random players) for
testing.
9. Replace the player factory with a single-player construction in the
main method like
public static void main(String[] args)
{
connect2server(args);
GPSinfo serverMetrics = LCPlayer.getServerGPSinfo();
AIRunner runner = new AIRunner( serverMetrics, "R100",
RemoteObjectsApplication.RUNNER, 100 );
runner.identifyPlayer();
try { Thread.sleep( 2000 ); }
catch (InterruptedException e) {}
runner.enterScenario();
}
Now a game can be started:
1. Start ServerEngine .
2. Start the new player, i.e., AIRunner .
3. Start one or more GUIPlayer s.
4. Start one or more RandomPlayer s to complete the actors.
Be sure to provide individual IDs, when using more than one GUI player!
The GUI players can be used to direct the game.
 
Search WWH ::




Custom Search