|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectvooga.games.tron.eventsystem.UserInputEvent
vooga.games.tron.eventsystem.UserInputEventAdaptor
vooga.games.tron.ComputerController
public class ComputerController
Constructor Summary | |
---|---|
ComputerController(Game game,
TronPlayer player)
|
Method Summary | |
---|---|
void |
aiUpdate(java.util.List<TronPlayer> tronPlayerList,
boolean[][] levelBlocks)
This is the main class that implements the AI algorithm for the computer-controlled player |
void |
down()
performs down turning |
void |
handleLeftRight()
This methods handles the upcoming left/right turn by taking into account the previous turns. |
void |
handleUpDown()
This method handles the upcoming up/down turning by taking into account the previous turns. |
void |
left()
|
void |
randomLeftRight()
This method randomly decides whether to turn left or right. |
void |
randomUpDown()
This methods randomly decides whether to turn up or down |
void |
react(int row,
int col,
java.lang.String direction,
boolean[][] blocksTaken)
This is a subroutine of the AIupdate method that makes the computer-controlled player react to obstacles ahead and make turns accordingly. |
void |
right()
|
void |
up()
|
Methods inherited from class vooga.games.tron.eventsystem.UserInputEventAdaptor |
---|
mouseLeftPressed, mouseRightPressed, spacePressed |
Methods inherited from class vooga.games.tron.eventsystem.UserInputEvent |
---|
checkInput |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComputerController(Game game, TronPlayer player)
Method Detail |
---|
public void aiUpdate(java.util.List<TronPlayer> tronPlayerList, boolean[][] levelBlocks)
tronPlayerList
- levelBlocks
- public void react(int row, int col, java.lang.String direction, boolean[][] blocksTaken)
row
- col
- direction
- blocksTaken
- public void handleLeftRight()
public void handleUpDown()
public void randomLeftRight()
public void randomUpDown()
public void down()
down
in class UserInputEventAdaptor
public void left()
left
in class UserInputEventAdaptor
public void right()
right
in class UserInputEventAdaptor
public void up()
up
in class UserInputEventAdaptor
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |