Like in my previous discussion I am trying to make a settings menu in my Settings world where it has options such as a button that mutes sound effects from actors in my PlayWorld. I did try to change or add the extend to World, but I am not doing something right because it will not accept it. Hi all, Id thought that I would create another discussion in case there are people who also have the same problem as me. ![]() 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. This is a full saving and making sounds lesson, via Greenfoot, is an easy to understand lesson with full teaching code, and completely editable. As the next Greenfoot release nears, and I mentioned sound support in my last post, there’s now a short demo video available. If the crab is still at the edge when the. Im working on a game program for school and there are multiple levels. The Crab object will then always keep a reference to the one GreenfootSound object created (instead of creating multiple GreenfootSound object and having them play over the top of each other). move line 4 to before line 1 so you only. Each time you call the method, you are creating a new (and different) GreenfootSound object which is not what you want (obviously). 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. First, move line 16 to outside the method. The problem is that the GreenfootSound object you just created on line 4 could not be playing (you just created it, so how could it be playing). If you want, you can download the scenario and change the sounds. 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"). This is a really boring scenario where you press the right or left arrow keys to make noise. ![]() 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |