/** Realiza los graficos correspondientes a la muerte del bomberman */ public void muereGrafico() { for (int i = 0; i < 6; i++) { try { BT.sleep(250); BomberLabel.setIcon(BombermanMuere[i]); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } BomberLabel.setIcon(null); miGUI.BombermanMuere(); }
/** * Realiza el movimiento grafico del bomberman, dado una direccion * * @param indice int direccion */ public void movimientoGrafico(int indice) { int velo = MovPix / MovBomb; try { if (indice == 0) // arriba { for (int i = 0, arg = 0; i < velo; i++, arg = (arg + 1) % 3) { BomberLabel.setLocation(BomberLabel.getX(), BomberLabel.getY() - MovBomb); BomberLabel.setIcon(BombermanArriba[arg]); BT.sleep(velocidadSleep); } } else if (indice == 1) // abajo { for (int i = 0, arg = 0; i < velo; i++, arg = (arg + 1) % 3) { BomberLabel.setLocation(BomberLabel.getX(), BomberLabel.getY() + MovBomb); BomberLabel.setIcon(BombermanAbajo[arg]); BT.sleep(velocidadSleep); } } else if (indice == 2) // izq { for (int i = 0, arg = 0; i < velo; i++, arg = (arg + 1) % 3) { BomberLabel.setLocation(BomberLabel.getX() - MovBomb, BomberLabel.getY()); BomberLabel.setIcon(BombermanIzquierda[arg]); BT.sleep(velocidadSleep); } } else if (indice == 3) // der { for (int i = 0, arg = 0; i < velo; i++, arg = (arg + 1) % 3) { BomberLabel.setLocation(BomberLabel.getX() + MovBomb, BomberLabel.getY()); BomberLabel.setIcon(BombermanDerecha[arg]); BT.sleep(velocidadSleep); } } } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } }