This site requires JavaScript, please enable it in your browser!
Greenfoot
Username
Password
Remember Me?
Sign Up, Lost Password
Activity
About
Documentation
Download
Discuss
Scenarios
Discussions
You need to login to take part
Current Discussions
Can't work out how to use <code>getText()</code>
By basil60, with 7 replies.
Last reply by danpost, about 11 years ago:
Maybe you should consult
this page
of the java tutorials.
How do i figure out what pixels are with color/alpha values?
By blangley83, with 1 reply.
Replied to by danpost, about 11 years ago:
The fourth number is called the 'alpha' value. It is the value that is changed when you use 'setTransparency' on an image. The value you give in the 'setTransparency' call is what the alpha value is set to. Unfortunately, the name of the method is sort of the opposite of what it does (it should probably be called 'setOpaqueness'). That is, the lower the value given, the higher the actual transparency. At the high limit of the value, 255, the color (or image) is completely opaque (totally non-transparent). The lower the value set on the color, the fainter and less apparent the color beco
mouse input?
By blangley83, with 3 replies.
Last reply by danpost, about 11 years ago:
The five methods you mentioned above are all the Greenfoot class methods that deal with mouse input. The 'getMouseInfo' method does not deal with input; but, instead, provides a way to get more information about the mouse input (actor clicked, buttons pressed, click count and location of mouse).
Can't work out acceleration issues.
By Heavenly_Father_Banting, with 4 replies.
Last reply by danpost, about 11 years ago:
The fix was changing the last 'getY' in the angleTo method of the Mover class to 'getX' and changing the last 'getX' in the distanceTo method to 'getY'. You do not have to add the 'getExactX' and 'getExactY' methods if you do not want to. The exactX and exactY fields have protected access from within the Mover class meaning that can be directly referred to in its subclasses. You should, however, change the 'getX()'s and 'getY()'s within the first statements of the act methods of your sub-classes of Mover (Mass1 and Mass2) to 'exactX' and 'exactY' (or 'getExactX()' and 'getExactY()' if you
addObject (new Face) populates the wrong face.
By dhollan8, with 6 replies.
Last reply by danpost, about 11 years ago:
dhollan8 wrote...
Thank You, I will try this and see what happens. I went ahead and sent this to the instructor so it was on time, with the same question that I sent you. I'll let you know if removing the bracket helps.
It is the removal of line 12 that will help. The change in the 'lookForMe' method was to limit when the image of the actor is set to only when the state of intersection of a Me object changes (only at the time the Me object starts intersecting and at the time the Me object ends intersecting). Having the image set every act cycle is a CPU-hogger.
Calling a Method on an Actor Not Currently in the World
By ddemarco06, with 2 replies.
Last reply by ddemarco06, about 11 years ago:
@danpost That worked perfectly. Thanks very much!
Differentiating between mouseMoved and mouseClicked
By MontclairState, with 5 replies.
Last reply by MontclairState, about 11 years ago:
Sorry guys I just realized what was wrong. I was making the isMouseDown boolean false unless I clicked. Fixed it in the following.
I'm have problems making a flower blink
By meganw21, with 4 replies.
Last reply by sengst, about 11 years ago:
Ok, great!
[u]Can i have an actor change what its image is?[/u]
By thepangolin, with 4 replies.
Last reply by lordhershey, about 11 years ago:
you can do something like this: <Code Omitted> just make sure the ima
How do I do this?
By danaman2001, with 3 replies.
Last reply by danaman2001, about 11 years ago:
Thanks
How to access instance field of subclass of actor from subclass of World
By MusicPenguin, with 1 reply.
Replied to by danpost, about 11 years ago:
I was going to post this:
Where is the relevant code from the Tile class. You should probably post the entire class.
But, then I realized that you probably have bigger problems. Aren't you getting error messages saying something about calling non-static method in a static context? If you have several Tile objects and are trying to get the values from each one individually, the Tile class in itself cannot help. You need to refer to each Tile instance and get the values from them (how can the Tile class itself know which tile you want the value of?). By your use of 'null'
removeObject() method is not working
By sametguzelgun, with 2 replies.
Last reply by sametguzelgun, about 11 years ago:
Thank you. I solved this problem:
Start of Game
By Connected!, with 2 replies.
Last reply by danpost, about 11 years ago:
If you are unsure of how to do this, place the actors in your world manually and then go to the menubar and select 'Controls>Save the World'. This will create the code for you. Look in your subclass of World and inspect the code to see what it did. Start with only one or two objects so as not to complicate things too quickly. This is a good way to see your placing actors in code; but, once you learn how, move on and start coding it yourself (both, for the experience of doing it yourself and for more conciseness of code -- you will notice an abundance of excess code if you keep moving thing
please help me with my scenario
By vencetest, with 2 replies.
Last reply by danpost, about 11 years ago:
As far as getting the score to the scoreboard in the game over world, you first need a 'get' method in the Score class to return the value of 'int Score'. Then, you will need a local reference to the new game over world that you create in the Human class so you can change the 'int Score' value of its scoreboard to that of the scoreboard in the PoringShoot world:
Uploading Scenarios
By Connected!, with 1 reply.
Replied to by Ambar, about 11 years ago:
Open your scenario. choose Share from File menu.Now select publish Tab.
663
664
665
666
667
668
669
X