public void play(int Id)
    {
        if (delay[Id] > 2){
            if (Id == 2 && delay[2] < 4){       //if its an earth, the delay is longer
                return;                         //stops the lag from playing too much sound files
            }

            delay[Id] = 0;
            GreenfootSound s = new GreenfootSound (attack[Id-1]);
            s.setVolume (volume);
            s.play();
        }
    }