# Libgdx if statement is not working well

I am trying to make the player die when it hits the rock or the time is up and the score is not reached, in this code at the first if statement it works when Rockhit is true, the player jump and disappear at the bottom of screen and the music is work very well, but when the time is 0 and score is not reached , the player is jump and keeps going out of the top of screen and the sound is work but slow and not clear. (notice: that before I adding the Rockhit condition the player was going up out of screen and the voice wasn't clear) this is the code:

  public State getState()
{
//Gdx.app.log(Float.toString(b2body.getLinearVelocity().x),"hi");
if ((Hud.getTime()==0&& Hud.getScore()<(level*15)+50)|| Rockhit()) {
Fruits.manager.get("music/Backmusic.ogg", Music.class).stop();
Filter filter = new Filter();
for (Fixture fixture : b2body.getFixtureList())
fixture.setFilterData(filter);
b2body.applyLinearImpulse(new Vector2(0, 5f), b2body.getWorldCenter(), true);
//b2body.applyLinearImpulse(new Vector2(0,-2.5f), b2body.getWorldCenter(), true);
Fruits.manager.get("music/fail.mp3", Sound.class).play();

}

if((Hud.getTime()==0&& Hud.getScore()>=(level*18)+50)|| (Hud.getScore()>=(level*15)+50)) {
Fruits.manager.get("music/Backmusic.ogg", Music.class).stop();
Fruits.manager.get("music/cheering.mp3", Sound.class).play();
return State.SUCCESS;
}
if (b2body.getLinearVelocity().x!=0)
return State.RUNNING;
else
return State.STANDING;

}


I don't know if the method you posted is called every frame, but (Hud.getTime()==0&& Hud.getScore()<(level*15)+50) will always be true once the time is up. (thus giving that linear impulse and starting the sound every frame). I would try to nullate the score.