Back to Blog
Greenfoot iskeydown6/16/2023 But often, actors change image during execution of the scenario, and then the setImage method is needed. Mark for Review (1) Points if (&isDown Greenfoot.isKeyDown ('d')) if (isDown & Greenfoot.isKeyDown ('d')) if (isDown & Greenfoot.isKeyDown ('d')) () if (Greenfoot.isKeyDown & isDown ('d') ) Correct 42. If an actor’s image never changes, this method is not needed at all, because any actor gets the image from the class automatically when it does not specify another image to use. How would the following sentence be written in Greenfoot source code If Dukes leg is down, and the keyboard key 'd' is down. The following methods of class Greenfoot are not supported by Droidfoot: getMicLevel. The most common method to set an image for an actor is via the setImage(String filename) method. From your Greenfoot lessons, the keyDown method is Mark for located in which class Review (1) Points Actor Greenfoot () GreenfootImage World Correct 41. 3.25 Do this: Open up the Greenfoot API and look in the Greenfoot class under Method and Description for a method that will pause the execution. The method we are looking for is in the Greenfoot class. Here are some of the things I came across while writing a few scenarios that I found helpful. Select an image from the Greenfoot library Import an image Correct Correct 1. So you can see that Greenfoot has nine classes: Actor, Color, Font, Greenfoot, GreenfootImage, GreenfootSound, MouseInfo, Userinfo, and World. Still, there are a lot of things that can be done well or less well. At least if you know how to program in gerenral. The isKeyDown method is a Greenfoot class command, not a command of the Actor or Boat classes, so the word Greenfoot must be typed before it. The boat will turn left only if this is true. Greenfoot programming is – on the whole – reasonable straight forward. The program looks to see if the left key is pressed down.
0 Comments
Read More
Leave a Reply. |