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
garbage collection
By PetroGR, with 19 replies.
Last reply by danpost, about 4 years ago:
PetroGR wrote...
I'm talking about learning Java using Greenfoot.
Greenfoot IS Java. Its classes are provided to allow a beginner to start creating games and simulations right from the start. I believe you are correct in that the tutorial should mention how you can inspect an object in greenfoot. Right-clicking on the world and selecting
Inspect
on the pup-up will show all field values, not just from in
MyWorld
, but also from in
World
. The same goes for an
Actor
object. Inspecting an actor will show fields provided in the
Actor
class (namely:
copys of objects get affected when one is triggered
By Aaron-aid, with 2 replies.
Last reply by Aaron-aid, about 4 years ago:
yeah removing it fixed it
Auf attribute anderer Objekte zugreifen
By Schüler, with 2 replies.
Last reply by Schüler, about 4 years ago:
thanks
Shark Shooter
By juniarta.2, with no replies.
Shark Shooter Games
Trouble moving individual objects
By star101, with 3 replies.
Last reply by danpost, about 4 years ago:
star101 wrote...
my problem is that, at the moment they are each doing the same movement but I will change that later and if I put it in the Actor class they all must move the same way
Lines 4 thru 8 are executed every act step. Therefore, on act steps that do not have
tme%100
equal to
0
, you are not working with the actors in the world in lines 26 thru 40. Note: I am kind of surprised that you are not getting errors on the
move
lines between 26 and 40 as the actors should be in the world for
move
to find their locations in the world. Create the
No
How to showText for a seconds and remove it after few seconds
By loremipsum, with 11 replies.
Last reply by loremipsum, about 4 years ago:
danpost wrote...
The delay was only delaying the entire program above because the stage was being shown repeatedly/continually. The following will only show the stage once, delaying only while the stage is being shown: <Code Omitted>
woah Thankyou so much, finally got it hehe Thanks!.
Web version different from original
By Windeycastle, with 5 replies.
Last reply by Windeycastle, about 4 years ago:
Seems like I'll have to redo it for a big part to organise it better.
Saving 2 high scores seperately at a time
By Roshan123, with 39 replies.
Last reply by Roshan123, about 4 years ago:
Ohh sorry, actually i found ur website where u mentioned that u r a java programmer and i took "java programmer" as "Certified java programmer" in my mind Even if i visited that app but their was no reply from u. I thought u used it long years ago so i left it
Recover deleted class
By mr_alex, with 1 reply.
Replied to by danpost, about 4 years ago:
mr_alex wrote...
I deleted a class without wanting to. How do I get it back?
You cannot, unless you saved your scenario under a different name with the class in it (or posted/saved the class somewhere else).
NullPointerException and I don't know why
By mr_alex, with 2 replies.
Last reply by mr_alex, about 4 years ago:
danpost wrote...
mr_alex wrote...
it throws this exception: <Code Omitted> The error must be in this Part of the code: <Code Omitted>
Correct. The
getWorld
method returns the world the actor is currently in. However, the actor is not in any world while it is being created (initiated). Fields with declared values are assigned during creation and the constructor is executed during creation. During that time
getWorld
will return a
null
value. You could override the
Actor
class instant method
adde
Making non-repearing numbers?
By TrippSci, with 14 replies.
Last reply by TrippSci, about 4 years ago:
Spock47 wrote...
It is "n-tuples" (i.e. list of numbers, ordered, with repetition), so the formula is k^n with k is the number of possibilities per feature and n is the number of features. So, in your case, you have 5^5 = 3125, so you already have the right number. I guess, there was a small typo in one of the lines in the method setPartNumbers: <Code Omitted>(n should start at 1, not at 5)
Thank you so much now its making much more sense!
Weird switch behaviour
By Windeycastle, with 3 replies.
Last reply by Windeycastle, about 4 years ago:
Aha! That's what I forgot! Thank you very much for the clear explanation!
Bilderwechsel nach drehung?
By Maxidino, with 20 replies.
Last reply by Spock47, about 4 years ago:
(english version follows below) getWidth liefert die Breite der Welt zurück. Insgesamt prüft die Bedingung <Code Omitted>ob das Schiff nahe dem Rand der Welt ist. Das tut sie in zwei Teilen: 1. getX() < 30 prüft, ob das Schiff am linken Rand der Welt ist: ob die x-Koordinate des Schiffes kleiner ist als 30. 2. getX() > getWorld().getWidth()-30 prüft, ob das Schiff nahe dem rechten Rand der Welt ist: die Breite (getWidth) ist auch die höchste x-Koordindate. Wenn also die x-Koordinate des Schiffes größer ist als Breite - 30, dann hei
my game wont play(link)
By Aaron-aid, with no replies.
https://www.greenfoot.org/scenarios/28696 when i boot this up on my laptop i get the error Your browser is ignoring the <APPLET> tag. i get it aswell when i run it on other peoples laptop at my school, but the other projects work just fine, the project has open code can anyone plz help!
using a variable from another class in the world class
By xixEmilyxix, with 43 replies.
Last reply by xixEmilyxix, about 4 years ago:
thank you its all fixed now
57
58
59
60
61
62
63
X