AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Play stop sound greenfoot3/16/2024 ![]() There is a way to create an Actor or World object that does not belong to any pre-defined subclass even though those classes are abstract. If you are using aySound('Theme1.mp3') to start the music, then because you do not retain a reference to the sound, you cannot stop it. Thought of the day: how can a program ever return a false value when asked if it is running? (if it is not running, then what is causing the statement to be executed). void: playLoop() Startet das Abspielen des Sounds in einer sich wiederholenden Schleife. Anyway, it is nothing like the 'isPlaying' method. ![]() I want my music to stop and start at the touch of a key, not continue playing only if the 'M' key is still down. There may be instances where you may want to call it however, it is mainly called internally by greenfoot when the 'Pause' button is clicked or a 'Greenfoot.stop()' method is executed (when the scenario goes from a running state to a stopped state). Thanks, but the 'isKeyDown' method only checks to see if the key is currently down. Finally, the 'stopped' method is usually not called explicitly. Second, the return type of the 'stopped' method is void, meaning that it will not return a true/false value. This means you must supply a world object to execute the method on (which world object is the method being called on). sound of hobbling feet, and a very attenuated, tremulous voice asked. One way is to use the Greenfoot class method 'playSound' the other is to actually create a GreenfootSound object and use the methods provided in the GreenfootSound class to control it. play just the faintest line of thin white hair at the front, and tied under. GreenfootSound song new GreenfootSound ( 'song. You cannot use song.stop() unless you first use ay() and have a reference to song declared in the class. I know I asked a lot of questions but I honestly appreciate any help I can get with this project.First, the 'stopped' method is not a static method. It can be a bit confusing - especially because there are two different ways to have music play within greenfoot. Im stuck with the following problem: I have a MainmenuWorld, where I start playing a sound named 'song' in a loop. 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? For each level however how am I supposed to STOP the current sound playing? For the first (main menu) I suppose I could just run it in the world class. I want my sound file to play only when the new world is loaded. You should see a green wave, and when you press play you should hear your noise played back to you. My main question is for what I'm working on right now. Press the record button and speak (or scrunch an empty food packet, or whatever), then press stop. 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. When this new world loads it will populate my world according to where I want all my actors placed. I have music that I want to start playing at the start of each level. If not, there is a problem with your microphone - try googling to get help with that. ![]() ![]() When a world is completed I will be using the setWorld command to load a new one. Press the record button and speak (or scrunch an empty food packet, or whatever), then press stop. ![]() My main question is how I should be organizing my game and where I should be initializing the sound.Ĭurrently I have a new world for each level. I've started creating a Platformer game and decided to implement music. ![]()
0 Comments
Read More
Leave a Reply. |