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
Need help with Array in constructor
By troubleturtle, with 1 reply.
Replied to by danpost, over 8 years ago:
The line creating the Alligator (in the 'prepare' method) is passing three int values -- not two int values and one int array. You can create an int array as follows: <Code Omitted>I did use code tags to show this, however, bear in mind that given is not a complete line of code -- just an example of how to create an int array within a line of code.
.setFont no longer compatible with java.awt.Font?
By Wasupmacuz, with 4 replies.
Last reply by Wasupmacuz, over 8 years ago:
danpost wrote...
Wasupmacuz wrote...
do you know where to get the latest update before this conversion?
See the bottom of the
Download page
for 'Old versions'. I guess you would want the version 3.0.3 as I think they added the Color and Font classes to greenfoot in version 3.1.0.
Thanks Dan!
Help With Title Screen
By LlamaDelRay, with 3 replies.
Last reply by danpost, over 8 years ago:
Now wonder your Maze world is showing up immediately -- the first thing you are doing in the act method is unconditionally calling 'click'. The rest of the act method does not look so good either -- you would have to click the start button 2000 times before a Maze world is activated.
How to return a method with boolean type?
By ML31, with 1 reply.
Replied to by danpost, over 8 years ago:
I think the problem is that 'isFlipped' is never true -- nowhere is it being set to true.
Play GIF once?
By Recorsi, with 3 replies.
Last reply by danpost, over 8 years ago:
The only thing you have to go on are the images that the GifImage object uses. That is, the only method that is available in the GifImage class that gives you any information about the animation is the 'getImages' method that returns a List object containing the images it uses. Fortunately, that is enough as you just need to be able to check when the first image is used and stop the animation when it is used the second time. Okay, to do that, you will need to retain a reference to the first image and a booleen that tracks when it is not being used (set to false when the first image is being
Delete Object after time?
By Lennart4091, with 2 replies.
Last reply by Lennart4091, over 8 years ago:
Thank you very much for the quick answer. Good evening.
Help with collision detection.
By Beamo, with 2 replies.
Last reply by danpost, over 8 years ago:
The biggest problem here is that an eyes object is NOT a TheFace object. The eyes may be a part of, or belong to, a face; but, the eyes are not a face. Only subclass to give more specificity to a type of object. Do not subclass to describe only a part of an object. For example, a car, a truck and a bus are all vehicles; but headlights, brakes and an engine are not. If you want to show ownership of the eyes to a face, place the eyes class within the class of the TheFace class. All eyes objects will then belong to one specific TheFace object and the eyes can refer to its owner as 'TheFa
Help PLEASE
By RKA, with 2 replies.
Last reply by davmac, over 8 years ago:
Please do not WRITE IN ALL CAPS because then IT SEEMS LIKE YOU'RE SHOUTING! Also read
this
for how to get started.
help wall collision
By theCode, with 5 replies.
Last reply by Super_Hippo, over 8 years ago:
This code is only working if dx represents the movement in x-direction and the actor just moved dx*xSpeed (so -dx*xSpeed will place the actor where it was). Then you can do the same with the y-direction.
Ayuda para un novato
By CarlosSeda, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
Utilice el botón en la esquina superior derecha. Use the Export button in the upper right corner. (I don't speak Spanish.)
i want to add lives in my project, how can i do that
By Livesmaker, with 1 reply.
Replied to by danpost, over 8 years ago:
What part are you having trouble with -- the counting of times, the checking of the count, or the displaying of the game over screen? And, what have you tried?
Trying to reset actor back to original after a certain point.
By Drew-Hughes, with 1 reply.
Replied to by danpost, over 8 years ago:
Best would be to retain the original image in a field and make a copy of it to scale when needed. It might make it easier if you also used the stored value as a factor in the scaling: <Code Omitted>You should be able to replace lines 12 through 34 with
voter app prev record not showing up neither next
By divinity, with 1 reply.
Replied to by danpost, over 8 years ago:
Maybe I am missing something; but, I do not see at all where you might be using the VotersInfo class at (I do not see any VotersInfo object being created or any code that tries to use a VotersInfo object). Could you possibly direct me to where the class or any object of that class is being used, please.
Rotate an image scaled keeping scale
By Arkin, with 11 replies.
Last reply by danpost, over 8 years ago:
This is probably possible; but, it would take a bit of doing to code it properly. The first thing to understand is what happens when the size of an image is changed. When making an image larger (in one or both dimensions), pixilation occurs due to filling in the new area; and when making an image smaller (in one or both dimensions), degradation in quality (loss of detail) occurs due to the removal of some of the image. This being said, constantly scaling an image over time will dramatically distort the image (especially when rotating it also). Therefore, you should keep a base image at han
Is there a way to add many of one actor, in a small amount of code?
By Beamo, with 5 replies.
Last reply by Beamo, over 8 years ago:
Ah I see! I kept adding to that value, while I should have been subtracting from it. Thanks again!
320
321
322
323
324
325
326
X