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

2016/4/3

Background music problem

Cameronte10 Cameronte10

2016/4/3

#
I have a title screen that starts playing music but when i want the music to stop playing i am not in the title screen and i can't figure out how to stop the music. i have tried
if(player != null)
        {
            Title.main.bg.pause();
            Greenfoot.setWorld(new Fight());
        }
no errors occur but the music does not stop.
danpost danpost

2016/4/3

#
If the 'bg' field was made 'static', you could change line 3 to:
Title.bg..pause();
and it should work.
You need to login to post a reply.