Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.

Commit

Permalink
updated activateLaser, fixed bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
marenandrea committed Apr 30, 2019
1 parent 64a68e9 commit efa1c2e
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions src/main/java/sky7/game/Game.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import sky7.board.ICell;
import sky7.board.cellContents.Active.CogWheel;
import sky7.board.cellContents.Active.Laser;
import sky7.board.cellContents.Active.Pusher;
import sky7.board.cellContents.DIRECTION;
import sky7.board.cellContents.Inactive.Flag;
import sky7.board.cellContents.Inactive.Hole;
Expand Down Expand Up @@ -260,19 +259,7 @@ private void show(List<?> lasers, List<?> laserPos) {
}

private void activatePushers(int phaseNr) {
for (int i = 0; i < board.getRobots().length; i++) {
for (ICell cell : board.getCell(board.getRobotPos()[i])) {
if (cell instanceof Pusher) {
if (((Pusher) cell).doActivate(phaseNr)) {
if (robotCanGo(board.getRobots()[i].getId(), board.getPushers().get(i).getDirection())) {
movePlayer(board.getRobots()[i].getId(), board.getPushers().get(i).getDirection());
}
}
}
}
}

/*for(int i=0; i<board.getPushers().size(); i++){
for(int i=0; i<board.getPushers().size(); i++){
for(int j=0; j<board.getRobots().length; j++){
if(board.getPusherPos().get(i).equals(board.getRobotPos()[j])){
if(board.getPushers().get(i).doActivate(phaseNr)){
Expand All @@ -282,7 +269,7 @@ private void activatePushers(int phaseNr) {
}
}
}
}*/
}
render(50);
}

Expand Down

0 comments on commit efa1c2e

Please sign in to comment.