Greenfoot sound files

broken image

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. But, the above should get your fields (which I renamed to more properly fit what they represent) and their references set up properly. I am quite sure that things will need to be tended to there as well. REUTERS/Mike Blake/File Photo Purchase Licensing Rights.

broken image

This also does not presume that the rest of the class is fine and correct.

broken image

I presumes that your sound files are '.mp3' files - if not, you need to make the necessary correction. If(!selected & Greenfoot.mouseClicked(this)) This shows the adjustments to the beginning of your class. Public PlayMusicButton(String soundFiles, String songNames, Color colors) In the Component 2 exam of the WJEC / Eduqas 2016 specification, an audio file will be placed in the sounds folder already. The methods getKey() and isKeyDown() are used for this and they return/understand the. Part of the functionality provided by this class is the ability to retrieve keyboard input. Public class PlayMusicButton extends Actor Check the Sounds Folder Greenfoot Tutorial Sound files must be placed the 'sounds' folder of your Greenfoot project to be used in the game. This utility class provides methods to control the simulation and interact with the system.

broken image