protected void update() {
    double val = Math.sqrt(movX * movX + movY * movY);
    if (val > 0) {
      posX += movX * speed / val;
      posY += movY * speed / val;
    }


    if (posX < Main.EDGE) {
      // posX = Main.FRAME_X - Main.EDGE;
      // posX = Main.FRAME_X / 2;
      // posX += 1;
      life.kill();
    }
    if (posY < Main.EDGE) {
      // posY =  Main.FRAME_Y - Main.EDGE;
      life.kill();
      // posX = Main.FRAME_Y / 2;
      // posY += 1;
    }
    if (posX > Main.FRAME_X - Main.EDGE) {
      // posX = Main.EDGE;
      // posX = Main.FRAME_X / 2;
      life.kill();
      // posX -= 1;
    }
    if (posY > Main.FRAME_Y - Main.EDGE) {
      // posY = Main.EDGE;
      // posX = Main.FRAME_Y / 2;
      life.kill();
      // posY -= 1;
    }

    movX = 0;
    movY = 0;

    action(1);
  }