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.
-
debug
-
-
sh
- The Ship that embodies the position,life,fuel of the robot.
-
st
- The socket reader thread that this robot uses to talk to the user's
thip.
-
RemoteRobot(GameServer)
- Create a socket reader thread, and wait for it to run.
-
Move()
- Move toward the ship we have been designated to follow.
-
follow(Ship)
- Set the specified ship as the one to follow.
-
run()
- The main loop for the robot thread.
debug
public static boolean debug
sh
public Ship sh
- The Ship that embodies the position,life,fuel of the robot.
st
public RServerThread st
- The socket reader thread that this robot uses to talk to the user's
thip.
RemoteRobot
public RemoteRobot(GameServer ga)
- Create a socket reader thread, and wait for it to run. Create a
Robot Ship.
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
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.
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