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
Greenfoot 3.8.2 released, fixes bug with sharing scenario on website
By nccb, with no replies.
Just to let you know that Greenfoot 3.8.2 is now available from the Download tab. We inadvertently introduced a bug in 3.8.1 last month that prevented you sharing new scenarios to the website (or modifying the thumbnail screenshot when uploading a new version) -- it would just sit there and seem to process forever. Installing version 3.8.2 should fix this bug and let you upload again. (While I'm doing an announcement, we've also adjusted our spam filter to try to eliminate the wave of spam that hit the forum over the last week, and so far it seems to have worked.)
help!!!!
By MARTINabab, with 1 reply.
Replied to by danpost, over 1 year ago:
MARTINabab wrote...
How can I make a cycle where a character actor walks over a ground actor and when that ground actor disappears from the screen it is generated again after another ground actor?
Have width of ground actor equal to width of world. Then, create two
Ground
actors and place them one world width apart from each other. You will need an unbounded world for this to work, so the two ground actors can play "leap-frog" with each other:
How can I modify an int value from a different class?
By alexn256, with 2 replies.
Last reply by jherper25, over 1 year ago:
:)
Joy of Code Links
By marcriemer, with no replies.
Hello, The Joy of Code links do not seem to be working on: https://greenfoot.org/doc/joy-of-code I have found another page that seems to have working links https://blogs.kcl.ac.uk/proged/joc/
My score counter doesn't add up but resets even though it's static
By SergeantBoomie, with 3 replies.
Last reply by danpost, over 1 year ago:
SergeantBoomie wrote...
I thought that it was already stored in the MyWorld class? How do I change it so the addScore method works in MyWorld?
Yeah, but it is only getting the current projectile's scores. It is not combining the scores of all previous projectiles. Plus, it probably should not be a
static
field as one
score
field should suffice for one run of the scenario. Just move the score-related fields to the MyWorld class add a method to adjust the score in that class:
Hello, I was working on my game and i had like an animation and I need it to turn around so i am asking how to mirror/turn the actor.
By bonamin, with 1 reply.
Replied to by danpost, over 1 year ago:
bonamin wrote...
How to Turn/Mirror actor
Copy the images. Mirror the copies. Use one set for right, the other for left.
Linux project export
By yumvinegar, with 2 replies.
Last reply by yumvinegar, over 1 year ago:
nccb wrote...
What error does it give when you try to run it with that command?
It doesn't give any errors. The terminal shows that something is running, but nothing pops up on the screen.
I need help with checking image
By TrueForm, with 5 replies.
Last reply by TrueForm, over 1 year ago:
Thank you very much. I am new to green foot and java. Still figuring things out. And its my bad submitting such complicated game proposal.
problem transferring variable
By btheys, with 1 reply.
Replied to by Super_Hippo, over 1 year ago:
The constructor of a class is called when an object of that class is created (for example “new Dialoogbox(...)”). At that point, it isn’t in a World and “getWorld()” returns null.
Turn actor invisible from another actor
By Lupical, with 3 replies.
Last reply by Lupical, over 1 year ago:
So the reason I used such overcomplicated code was because I used move() before and the actor was only moving horizontally, vertically or diagonal, so I thought that was a limitation of move(), but apparently that was just my fault. Thank you very much, danpost, you helped me a lot.
Game works in Greenfoot but not on in Browser
By BenZim, with 2 replies.
Last reply by BenZim, over 1 year ago:
Thank you so much for looking into my code, nccb! I reworked the whole project and replaced the enum by an int. The game works now, but the font is changed to a serif font (i used "SansSerif"), my graphic animations (scale) are blurry now and it works really slow on the firefox browser, while edge is playing in normal time.
Need help with removing object
By Matetity, with 3 replies.
Last reply by Matetity, over 1 year ago:
thank you so much, it works now!!
setBackground() weird behavior
By MRCampbell, with 2 replies.
Last reply by MRCampbell, over 1 year ago:
Thank you so much for your time and explanation.
nccb wrote...
see through time
is really the only explanation that makes sense when you try to describe what is shown when you run this visualization. I have filled in the background but am still curious. Is there anywhere I can go to figure out what causes this? I guess I am trying to figure out what you mean by
nccb wrote...
Greenfoot doesn't work very well with transparent world backgrounds; each loop it re-uses the same destination image buffer internally, draws your world...
I want to change the world
By ElSupremo001, with 1 reply.
Replied to by danpost, over 1 year ago:
ElSupremo001 wrote...
Hey, I'm new and I want to know how I can change the world by clicking on the world. Like a play button and change the world and start playing. Please
The following in the
act
method of your world should suffice to proceed to a
GameWorld
world: <Code Omitted>
Help With A Doodle Game.
By yesineedhelp, with 3 replies.
Last reply by danpost, over 1 year ago:
Here are a couple helpful thoughts: (1) In your world constructor ("public MyWorld()" block), add the following line so the
Doodle
object is drawn on top of all other actors: <Code Omitted> (2) The
Doodle
object can hold a reference to the car and therefore control it, when needed. This will require the
Doodle
object act after the
Car
object; so, also in the world constructor, add the following line: <Code Omitted> Since the
Doodle
is the user-controlled actor, the interaction with
Car
obje
13
14
15
16
17
18
19
X