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

2013/5/2

How do a make a song play in the background of my program?

QWERTY894 QWERTY894

2013/5/2

#
I used the Greenfoot.playSound() method in the act() method of the background and it keeps starting the song continuously on top of itself
bourne bourne

2013/5/2

#
It seems you are calling Greenfoot.playSound() every act cycle. Try calling it in the World constructor
QWERTY894 QWERTY894

2013/5/2

#
it says <identifier> expected
danpost danpost

2013/5/3

#
You have very little control of the sound when using the Greenfoot class 'playSound' method. There is no way to interrupt it and there is no way to determine when the sound finishes to re-start it. Better is creating a GreenfootSound object and calling 'play' on it. As a GreenfootSound object, you have full control of the sound through the methods in the GreenfootSound class.
QWERTY894 QWERTY894

2013/5/3

#
Thank you! It did the same thing again on the act() method but it gave me a new idea.
You need to login to post a reply.