![]() You could probably eliminate either the 'soundFiles' or the 'songNames' array and use the same data for both creating the sound objects and displaying their names. It seems a bit redundant to have two arrays with exactly the same data. To gain more control over the music, you must create and retain a GreenfootSound object in a field so you can call methods of the. It will only stop when you re-compile or leave the app. But, the above should get your fields (which I renamed to more properly fit what they represent) and their references set up properly. Hi guys Im still fairly new to greenfoot so need some basic help. 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. I am quite sure that things will need to be tended to there as well. This also does not presume that the rest of the class is fine and correct. which can be shortened to this: ( (MyWorld)getWorld ()).music.stop () This presumes you named the GreenfootSound object in MyWorld as music : public GreenfootSound music new GreenfootSound ('Music. Find information on how to change the interface language in Greenfoot, and get other translated materials. Greenfoot has been translated into many different languages. Player have to move a character to left or right where there are 2 boxes, with 'true' or 'false', if he wrongs I want play a sound, if he is right, then play another. I presumes that your sound files are ".mp3" files - if not, you need to make the necessary correction. For 32-bit support, use Greenfoot 3.5.4 from our old versions page. Hy to all, is that possible to make greenfoot play a soudn only if one actor touches another one. If(!selected & Greenfoot.mouseClicked(this)) This shows the adjustments to the beginning of your class. Public PlayMusicButton(String soundFiles, String songNames, Color colors) Public class PlayMusicButton extends Actor Use your Greenfoot knowldege: If an Actor class Fly has a variable defined to store the current speed, which of the following statements would successfully add a Fly and define the current speed as 2 Mark for Review.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |