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 random numbers and switch statements
By Zurah, with 2 replies.
Last reply by Zurah, about 5 years ago:
thanks, i used a slightly different method of achieving the same goal but i have it working now ^^
Jar File not working
By JustAnotherCoder, with no replies.
So I finished a simple game with Greenfoot and wanted to convert it to a Jar, I clicked the Share button and did that but when I tried to open it with JRE (Java Runtime Environment) Latest Version it said an error occured and nothing happened. Could someone please tell me why the Jar file I exported doesn't work? <Image Omitted>
Placing an actor by using another actor
By Bambus, with 6 replies.
Last reply by Bambus, about 5 years ago:
nevermind.. I just got it. But thanks to you two :D
Enemy movement
By Sakuya, with 2 replies.
Last reply by Sakuya, about 5 years ago:
Thanks!
How can I add invisible Walls?
By Sakuya, with 7 replies.
Last reply by Sakuya, about 5 years ago:
Thanks, it worked. Cant thank you both enough
Passing the score from one world onto the next world
By wslade, with 6 replies.
Last reply by wslade, about 5 years ago:
That worked! Thanks so much for your help!
Collecting all variables of a type in an array
By FirewolfTheBrave, with 4 replies.
Last reply by danpost, about 5 years ago:
FirewolfTheBrave wrote...
That seems to work, however, it's not exactly what I was looking for. I know how to write the loop iterating through the array, I was just looking for a method that can automate the creation of the array itself. I already have all images saved in a variable, but there's this one method for which I need them in an array, and since it's gonna be quite long, it would be nice to be able to automatically collect all variables of the type GreenfootImage into an array. Does such a method exist?
If your image file names are sequential (that is, like "image0.png", "imag
Get weather the act loop is running
By RcCookie, with 5 replies.
Last reply by danpost, about 5 years ago:
RcCookie wrote...
this thread will in fact keep running even if the scenario gets paused.
Use the
World
class
stopped
method to stop any running threads. There is a
started
method, also (if needed).
Little Crab Scenario
By SportingLife7, with 5 replies.
Last reply by SportingLife7, about 5 years ago:
Thank you so much, I really appreciate it (it worked!).
Smooth Movement upwards
By GLOBALHUNT, with 8 replies.
Last reply by Roshan123, about 5 years ago:
GLOBALHUNT wrote...
Can u rewrite the code and send
<Code Omitted> But i would like u to recommend to use Danpost's code(its better) and not mine.
Font from ttf or awt.Font
By Commentator, with 1 reply.
Replied to by danpost, about 5 years ago:
Commentator wrote...
How can one create a greenfoot Font from either a ttf file or from an java.awt.Font in the latest version of greenfoot (3.6.0)
I created a
TextImage
class which extends
GreenfootImage
that should work locally, but not when uploaded. You can find it
here
.
getWorld and getObject
By Patdumas77, with 2 replies.
Last reply by danpost, about 5 years ago:
19598 wrote...
getWorld().stop()
stop
is not a method in the
World
class and cannot be called on a
World
object.
The getObjects return an Actor object
It returns a
java.util.List
object (as you noted in your next sentence).
so you could do something like getWorld().getObjects() to get a List of Actor objects, and then do get() on the object you want from that list. It would look something like this: getWorld().getObjects().get(0).
The
List
object must not be empty when using
get
on it; and the
int
index o
transparency
By Sathya_srikanth, with 1 reply.
Replied to by danpost, about 5 years ago:
Sathya_srikanth wrote...
i need to reduce the transparency of an object every time it touches the other, say by 10
The
GreenfootImage
class has a
setTransparency
method you can use. You will need to track the currently set transparency value with an int field so you can first retain its current value and second limit any new value to the range (0, 255).
java.lang.NoClassDefFoundError : greenfoot javafx/application/application
By taufikridwan, with no replies.
I have installed oracle java, and in greenfoot the game runs normally, but after exporting it to the jar, and opening it via cmd the words "could not find or load main class greenfoot.export.GreenfootScenarioApplication. cation java.lang.NoClassDefFoundError: greenfoot javafx / application / application" What should I do to be able to open the jar file. thank you for helping
high score of players
By Sathya_srikanth, with 1 reply.
Replied to by danpost, about 5 years ago:
Sathya_srikanth wrote...
I'm trying to make a high score list of players
Please refer to my
UserInfo Demo
scenario as an example. The
ScoreBoard
class can be inported into your scenario via the menu bar ( w/"Edit >> Import class...").
96
97
98
99
100
101
102
X