Skip to content

Commit

Permalink
Hotfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pixxon committed May 20, 2016
1 parent 170b28e commit 124d74f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 9 deletions.
26 changes: 18 additions & 8 deletions src/main/java/bomberman/model/Model.java
Original file line number Diff line number Diff line change
Expand Up @@ -364,21 +364,31 @@ private void bombTimeOut(BombTimeOutEventArgs args){
}
}

for(Bomb b1: placedBombs){
if(b1.getPosX() == x && b1.getPosY() == y){
placedBombs.remove(b1);
for (Iterator<Bomb> iterator = placedBombs.iterator(); iterator.hasNext(); ) {
Bomb bomb = iterator.next();
if(bomb.getPosX() == x && bomb.getPosY() == y){
iterator.remove();
}
}

bombExplode(x,y);
gameTable.setField(x,y,new Flor(x,y));
gameAdvanced.notifyListeners(new GameAdvancedEventArg(x,y,FieldToActor(x,y).toString()));

for(int i = 1;i<= BOMB_RANGE; ++i){
bombExplode(x-i,y);
bombExplode(x+i,y);
bombExplode(x,y-i);
bombExplode(x,y+i);
for(int i = 1;i<= BOMB_RANGE && !(gameTable.getField(x-i, y) instanceof Wall); ++i){
bombExplode(x-i,y);
}

for(int i = 1;i<= BOMB_RANGE && !(gameTable.getField(x+i, y) instanceof Wall); ++i){
bombExplode(x+i,y);
}

for(int i = 1;i<= BOMB_RANGE && !(gameTable.getField(x, y-i) instanceof Wall); ++i){
bombExplode(x,y-i);
}

for(int i = 1;i<= BOMB_RANGE && !(gameTable.getField(x, y+i) instanceof Wall); ++i){
bombExplode(x,y+i);
}

int alive=0;
Expand Down
1 change: 0 additions & 1 deletion src/main/java/bomberman/view/View.java
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,6 @@ public void actionPerformed(Object sender, Object eventargs){
@Override
public void actionPerformed(Object sender, Object eventargs){
GameOverEventArg tmpGameOver = (GameOverEventArg)eventargs;
System.out.println("a");
if(tmpGameOver.getWinnerID() == iD){

Platform.runLater(new Runnable(){
Expand Down

0 comments on commit 124d74f

Please sign in to comment.