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 Question
By iLoveSko0l123, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
It is just there so you can see which is which easier. You can also change those colors or remove them completely. For background: Green is code for classes, yellow for methods, red for loops and blue for any other code blocks such as "if". White is the rest. For code itself: variable types (int, bytes, also return type void) and class/extends/... are red, some keywords (this, null, …) are blue, others (instanceof) are yellow. Access modifiers (private, public, …) are purple. Comments are blue or gray and the rest is black.
Hide Mouse Cursor
By Xevinaly, with 4 replies.
Last reply by danpost, over 7 years ago:
Super_Hippo wrote...
I was importing all that when I got it from somewhere... << Code Omitted >> Well, I don't really know how it worked. I only know that it is the scenario I can't get a HTML5 translation for even after removing it.
Okay -- yes. The
WorldCanvas
object was a
JPanel
object (a swing object) acquired via the
WorldHandler
object. The
Cursor
and
Toolkit
classes are both part of the
java.awt
package. I am not even sure if it is possible to acquire the world canvas in the later versions of greenfoot to begin with.
Problems with an Actor touching one of their subclasses
By loldertroll, with 3 replies.
Last reply by AdiBak, over 7 years ago:
You could try this: Actor
variable name
= (
subclass name
) getOneIntersectingObject(
subclass name
.class);
Cannot find variable 'counter'
By AmyIsBadAtCoding, with 3 replies.
Last reply by CreatorMoon, over 7 years ago:
See, that's what I'm trying to do.
How to change font size and colour?
By CreatorMoon, with 6 replies.
Last reply by CreatorMoon, over 7 years ago:
Thanks. I hope to use this next time.
End turn code not working
By excitedbubbles, with 4 replies.
Last reply by danpost, over 7 years ago:
There should be no problems with using
isKeyDown
here. However, best would be to control turn phase in your
World
subclass, not only because it is a function of the game itself (not the individual players), but also because you will only require one field instead of two.
stoping a sound when it reaches a subclass
By ErasedBlade, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
You need a reference to the GreenfootSound object which is playing. So when creating it, make sure you keep a reference to it or you will never be able to do anything with it afterwards.
Someone has already asked this, but my counter won't work across multiple worlds.
By AmyIsBadAtCoding, with 6 replies.
Last reply by AmyIsBadAtCoding, over 7 years ago:
ok ill go back and use the other thread
Fixing if objects are intersecting
By The_bazm, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
You need half of the sum of the height of both actor's images. So basically: <Code Omitted>with "obj" = the object which was intersected.
Boundaries and Scrolling World
By Joyfu1, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Show the class code of the actor which leaves the world. In your world, you don't have anything which would prevent objects from moving outside the world boundaries.
Scrolling Screen
By Çðæyœn, with 1 reply.
Replied to by danpost, over 7 years ago:
Çðæyœn wrote...
My issue is I have no idea how to make a scrolling screen that scrolls indefinitely at a constant rate, meaning that the movement of actors will not affect scrolling.
Please see my
Scrolling Tutorial
scenario.
On an unrelated note, I am also trying to figure out how to make an array list for asteroids, since the screen will scroll infinitely and asteroids will be randomly generated to be in random locations for the spaceship to avoid (asteroids cannot overlap and cannot be closer than a certain distance from o
My plane size editing code isn't working again!
By AmyIsBadAtCoding, with 4 replies.
Last reply by AmyIsBadAtCoding, over 7 years ago:
My IQ is so high lol
Greenfoot won't launch JavaFX error (Ubuntu 18.04)
By tomahok, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
So it works for you again?
How to remove an certain Object
By TobiMobi, with 2 replies.
Last reply by TobiMobi, over 7 years ago:
Thank you it works.
backgrounf image
By teo1105, with 1 reply.
Replied to by Super_Hippo, over 7 years ago:
Put this into the world's constructor. <Code Omitted>
185
186
187
188
189
190
191
X