Class gamesrv.RemoteRobot
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gamesrv.RemoteRobot

java.lang.Object
   |
   +----java.lang.Thread
           |
           +----gamesrv.RemoteRobot

public class RemoteRobot
extends Thread
A thread representing a local server and a single enemy ship that remorselessly tracks the user's ship until it blows it to Davey Jones' locker.

Variable Index

 o debug
 o sh
The Ship that embodies the position,life,fuel of the robot.
 o st
The socket reader thread that this robot uses to talk to the user's thip.

Constructor Index

 o RemoteRobot(GameServer)
Create a socket reader thread, and wait for it to run.

Method Index

 o Move()
Move toward the ship we have been designated to follow.
 o follow(Ship)
Set the specified ship as the one to follow.
 o run()
The main loop for the robot thread.

Variables

 o debug
  public static boolean debug
 o sh
  public Ship sh
The Ship that embodies the position,life,fuel of the robot.
 o st
  public RServerThread st
The socket reader thread that this robot uses to talk to the user's thip.

Constructors

 o RemoteRobot
  public RemoteRobot(GameServer ga)
Create a socket reader thread, and wait for it to run. Create a Robot Ship.

Methods

 o run
  public void run()
The main loop for the robot thread. Send a start message to the client, then sit in a loop moving toward the user and firing at him.
Overrides:
run in class Thread
 o follow
  public void follow(Ship enemy)
Set the specified ship as the one to follow. From now on, the robot will follow and shoot at this ship to the exclusion of all others.
 o Move
  public void Move()
Move toward the ship we have been designated to follow. If we get within 5X5 of the enemy, stop moving and blast away. If there is no enemy, don't move. Various randomizations determine the path taken. Various other randomizations control the position reported to the user.

All Packages  Class Hierarchy  This Package  Previous  Next  Index