There is a way to create an Actor or World object that does not belong to any pre-defined subclass even though those classes are abstract. If you want to use it in an actor subclass you can use it like this: GreenfootImage drawedImage new GreenfootImage ('imageName.png') //the image that is drawed getWorld ().getBackground ().drawImage (drawedImage, 100, 100) //this will draw the image at the position (100100) of the world //The images left top corner will be. Thought of the day: how can a program ever return a false value when asked if it is running? (if it is not running, then what is causing the statement to be executed). Anyway, it is nothing like the 'isPlaying' method. There may be instances where you may want to call it however, it is mainly called internally by greenfoot when the 'Pause' button is clicked or a 'Greenfoot.stop()' method is executed (when the scenario goes from a running state to a stopped state). Finally, the 'stopped' method is usually not called explicitly. Now when I open the page it goes blank after it initializes. 8 At first when I uploaded it there was an error, which I fixed by removing the function to save the current level to a file. Second, the return type of the 'stopped' method is void, meaning that it will not return a true/false value. My scenario is not working when I upload it to greenfoot. This means you must supply a world object to execute the method on (which world object is the method being called on). You should see a green wave, and when you press play you should hear your noise played back to you. First, the 'stopped' method is not a static method. Press the record button and speak (or scrunch an empty food packet, or whatever), then press stop.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |