This site requires JavaScript, please enable it in your browser!
Greenfoot back
moobe
moobe wrote ...

2013/1/19

Greenfoot sound

moobe moobe

2013/1/19

#
Hi, I know there is an other threat with a problem I also have, but this is something else again now :) I'd like to play a sound only - let's say - three times. How can I manage this? After it has played it for three times it shall start the next sound. Maybe something with time? Because I know the sound file's length. And now one other thing with the sound: Before the second sound starts, I'd like to decrease the first sound's volume step by step. I've written this code tight now:
    public void decreaseVolume()
    {
        for (int i = 100; i == 0; i--) 
        {
            music2.setVolume(i);
            Greenfoot.delay(10);
        }
        music2.stop();
    }
The problem now is that this code is executed in only one frame. Is it possible to solve this problem?
You need to login to post a reply.