New to Greenfoot. I've started creating a Platformer game and decided to implement music. My main question is how I should be organizing my game and where I should be initializing the sound.
Currently I have a new world for each level. When a world is completed I will be using the setWorld command to load a new one. When this new world loads it will populate my world according to where I want all my actors placed. This was how I saw my game being created, if you have any suggestions or objections to how I should be running it please tell me.
My main question is for what I'm working on right now. I want my sound file to play only when the new world is loaded. For the first (main menu) I suppose I could just run it in the world class. For each level however how am I supposed to STOP the current sound playing?
Ie. If MainMenuWorld starts playing "song1" and I click the play button which setWorld's Level1, how do I stop the music from MainMenuWorld? Should I be creating a Music actor that somehow plays the sounds? OR do I have to stop the sound before progressing to each new level?
I know I asked a lot of questions but I honestly appreciate any help I can get with this project. Thanks is advanced!