I did try to change or add the extend to World, but I am not doing something right because it will not accept it. 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. How to play sound correctly in Greenfoot.On screen exam GCSE Computer Science Eduqas specification, component 2.Thumbnail photo by Caspar Camille Rubin on Un. The Greenfoot class now has a method with the following signature: setWorld (World world) This method takes a world object as a parameter, and it will show that world in the Greenfoot main window. 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. Between the quotes is the name of the key, 'left' is the left cursor key, 'right' is right. 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"). We use the Greenfoot built-in methods for checking if a key is down. I want to spawn a car, a karen, and a kid. 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. add instance field to class GreenfootSound wind new GreenfootSound ('wind. Hi all, I have a question and a help request at the same time. To start the game, you have to press the run button and then space bar to start any of the code. To gain more control of the playing of a sound file, use the GreenfootSound constructor and methods. I am making a game where you have to dodge bullets to win. 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. Spawning character on key press & sound playing.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |