Hello Everyone !
I'm making a platform game which i will post in little over a week :) , but i'm still working on alot of problems.
One of them is the background music.
Let's say i have a sound called Trainingsground..
First, im declaring the sound at the top of my world, trainingGround like so :
Then, in my world prepare, i simply tell the world to play the sound in a look like so :
However, i need this sound to keep on playing ( which is does ) when i move to world 2..
But when im leaving world to and moving on to world 3, i need the sound to stop and play a different background tune.
I've tried to use the following in the 3rd world :
.
Sadly, the reference is lost and i cannot stop the sound from playing at this point.
Can anyone help me out on this :) ?
Can't wait to post this to you guys !
GreenfootSound trainingGround = new GreenfootSound("TrainingGround.wav");
trainingGround.playLoop();
trainingGround.stop);