Skip to content

Commit

Permalink
Merge branch 'master' into pacman-ai
Browse files Browse the repository at this point in the history
Conflicts:
	ai/fun/ghosts/MyFunGhosts.java
	game/Exec.java
	game/entries/ghosts/DistanceToPacMan.java
  • Loading branch information
tylorr committed Feb 2, 2012
2 parents 4f0ded6 + 23d3ab0 commit 161beeb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
5 changes: 2 additions & 3 deletions ai/fun/ghosts/MyFunGhosts.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,8 @@ public MyFunGhosts(){
}
//Place your game logic here to play the game as the ghosts
public int[] getActions(Game game,long timeDue)
{
//MyFunGhosts ghost = new MyFunGhosts();
Action nextAction = rootIsBlue.makeDecision(game); //exception here
{
Action nextAction = (Action) rootIsBlue.makeDecision(game); //exception here
return nextAction.execute(game);

}
Expand Down
10 changes: 5 additions & 5 deletions game/Exec.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public static void main(String[] args)
//exec.runMyExperiment(new Legacy2TheReckoning(), 100, 80, 95, 1);

//this can be used for numerical testing (non-visual, no delays)
// exec.runExperiment(new MyPacMan(),new MyGhosts(),100);
exec.runExperiment(new MyPacMan(),new MyGhosts(),100);


//run game without time limits (un-comment if required)
//exec.runGame(new RandomNonRevPacMan(),new MyFunGhosts(),true,G.DELAY);
//run game without time limits (un-comment if required)
// exec.runGame(new Human(),new MyFunGhosts(),true,G.DELAY);

//run game with time limits (un-comment if required)
// exec.runGameTimed(new Human(),new AttractRepelGhosts(true),true);
Expand All @@ -58,8 +58,8 @@ public static void main(String[] args)
//this allows you to record a game and replay it later. This could be very useful when
//running many games in non-visual mode - one can then pick out those that appear irregular
//and replay them in visual mode to see what is happening.
//you can play as pacman in this version but ghosts scatter at this point
//exec.runGameTimedAndRecorded(new Human(),new MyFunGhosts(),true,"human-v-Legacy2.txt");
//you can play as pacman in this version but ghosts scatter at this point
// exec.runGameTimedAndRecorded(new Human(),new MyFunGhosts(),true,"human-v-Legacy2.txt");
// exec.replayGame("human-v-Legacy2.txt");


Expand Down
4 changes: 2 additions & 2 deletions game/entries/ghosts/MyGhosts.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ public MyGhosts(){
rootIsBlue.falseNode = powerPill;
powerPill.falseNode = chasePacMan;
powerPill.trueNode = runAway;


}
//Place your game logic here to play the game as the ghosts
public int[] getActions(Game game,long timeDue)
{
MyGhosts ghost = new MyGhosts();
Action nextAction = (Action) ghost.rootIsBlue.makeDecision(game); //exception here
Action nextAction = (Action) rootIsBlue.makeDecision(game); //exception here
return nextAction.execute(game);

}
Expand Down

0 comments on commit 161beeb

Please sign in to comment.