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

2012/6/3

Adding background music?

1
2
Jesse_Orange Jesse_Orange

2012/6/5

#
package frogger does not exist?
SPower SPower

2012/6/5

#
What are you trying to import?
danpost danpost

2012/6/5

#
Did you enclose Frogger.mp3 in double quotes, like: "Frogger.mp3" ?
Nike.Sprite Nike.Sprite

2013/6/3

#
How to play a sound 1 time, not to repeat it every time ?
Solringolt Solringolt

2013/6/3

#
@Nike.Sprite use the classic Greenfoot.playSound("soundfilename.mp3");
Nike.Sprite Nike.Sprite

2013/6/3

#
nope, I just found it, I needed to set public void play() // play music 1 time. { Greenfoot.Sound("soundfilename.mp3"); } --> But I do not know how start a new song immediately after the first song.
danpost danpost

2013/6/3

#
There should be an 'isPlaying' method that returns a boolean value indicating whether a particular sound is playing or not. Use the 'act' method to check it, and when it returns 'false' start the new sound.
Nike.Sprite Nike.Sprite

2013/6/3

#
http://www.greenfoot.org/topics/find/25439#post_25439 could you answer on my question here too ?? ;p i'm almost done with my program.
DSP512 DSP512

2014/1/21

#
if I write "bg.pause();" then I get this message "Could not find symbol - method pause()"
danpost danpost

2014/1/22

#
DSP512 wrote...
if I write "bg.pause();" then I get this message "Could not find symbol - method pause()"
Chances are you do not have 'bg' declared as a GreenfootSound object.
DSP512 DSP512

2014/1/26

#
How exactly do I have to use the "isPlaying" method to play several sounds in series?
danpost danpost

2014/1/26

#
You would need a int 'songNum' field to track which song was last started, an array for the songs (as String filenames or as GreenfootSound objects). Then you can use
1
if (!songs[songNum].isPlaying() && songNum < songs.length-1) songs[++songNum].play();
You need to login to post a reply.
1
2