@Override public void Update() { if (explodeTime < 0) { exploded = true; for (Bomb b : Game.getInstance().playground().getBombs()) { if (b == this) { Game.getInstance().playground().removeBombs1(b); } } for (Bomb b : Game.getInstance().playground().getBombs2()) { if (b == this) { Game.getInstance().playground().removeBombs2(b); } } try { createFlames(); } catch (SlickException ex) { ex.printStackTrace(); } } explodeTime--; ArrayList<Player> players = Game.getInstance().getAllPlayers(); for (Player p : players) { if (intersects(p)) { if (!moving) { // p.setKick(true); if (p.getKick() && isKicked == false) { kickBomb(p.getKickDirection()); } } } } }
public void checkForBomb(float x, float y) { for (IGameObject o : Game.getInstance().playground().getMapobjects()) { if (o instanceof Bomb) { if (o.getX() == x && o.getY() == y) { Bomb bomb = (Bomb) o; bomb.setExplodeTime(0); } } } }