Greenfoot sound intermittent3/6/2024 ![]() I did try to change or add the extend to World, but I am not doing something right because it will not accept it. You create a GreenfootSound object and then call the setVolume method on that object GreenfootSound gfs new GreenfootSound ('wav.wav') gfs.setVolume (10) gfs.play () This snippet will create the object, set its volume and initiate the playing of the sound. wilhelm.wav at (SoundExceptionHandler. just copy all your sound files into the folder sounds in your project folder, then you can use them in your code with aySound ('sound.mp3') or ayLoop () if song is an GreenfootSound. You will have to copy/paste them into the sounds directory of your project. I don't know yet about the second question, as in I don't understand it yet :)Īnd, yes, it stops immediately after I click on the 'Run' button. It (and the other) is found in the GreenfootSound class as an object method. This is a full saving and making sounds lesson, via Greenfoot, is an easy to understand lesson with full teaching code, and completely editable. Ive been trying to figure out what exactly is the problem here class Player1 is supposed to play the wilhelm scream sound effect when hit by Player2Bullet. Greenfoot does not have an import function for sound files. Thank you for the reply, I checked if I maybe put it in more than one place, and it is only once in the Lobster. Press the space bar to explode the rocks. A new version of this scenario was uploaded on 19:35:22 UTC This demo shows how to create an explosion effect. ![]() The thing is that I am probably missing something, because no mater where I put it, it stops the game immediately and not when the Lobster eats the Crab.Where did you try to place the 'Greenfoot.stop() ' line? Did you place the line in more than one place in your code and forgot to remove one (possibly in a different class)? Is it stopping due to a thrown exception (does the terminal show up with a stack trace)? If it stops immediately after you click on the 'Run' button, you should probably show the code to your World subclass (class that "extends World"). ajccapella, there is a big green Open in Greenfoot button above the scenario frame on the right side click on it to download the source and view. Miro29 wrote.I want to stop the game after the Crab eats the Worm, and for that in the Greenfoot manual I found the Greenfoot.stop() method. when i shoot a space invader and when i get shot it has a slight delay so you can actually see the damagedimage and also i think it gives it gives a retro vibe, one problem is that when my ufo goes atop of the screen it has a 12 second sound clip playing but the delay doesnt pause it so if i hit a. Teaches: Use of GreenfootSound API to create and optimize music and sound effects.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |