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
adding scenario to site
By bogdysan00, with 5 replies.
Last reply by danpost, over 7 years ago:
bogdysan00 wrote...
This was not very helpful.. i still could not do it.
This: <iframe src="https://www.greenfoot.org/scenarios/23157?embed=true"></iframe> was given by the
Embed
link found to the lower right-hand corner of the scenario frame.
I need help with Objects spawning on each other
By Zestix, with 1 reply.
Replied to by danpost, over 7 years ago:
Zestix wrote...
Hey, I was trying to prevent Objects (no specific ones) from spawning on eachother. << Code Omitted >> The code itself seems to be okay but I dont know how to implement the addObject command, since I dont want to add a specific class.
Correct me if I am mistaken, but I would presume that the actor to be added would be
r
, from the parameter of the method. I am not sure how the method will eliminate overlapping. It will probably make it such that less than half any object already in the world will be overlapped by that which is added; but it will not completel
Need help
By IamSifter, with 1 reply.
Replied to by danpost, over 7 years ago:
IamSifter wrote...
The game I created on greenfoot won't reset when I press the "reset" button but forces me to restart my page. Pls help.
I believe it has something to do with the usage of GreenfootSound objects.
I've been working on a project in greenfoot and i need help on Character selection.
By SniperRocks, with 31 replies.
Last reply by danpost, over 7 years ago:
SniperRocks wrote...
wait what? is this what you mean?
No. Remove line 7 from your last
selection
class code post -- this line: <Code Omitted>Apparently, you changed the name. In your
Arenaone
class, you have that same line, which assigns
playerone
in the
selection
class to a field called
player
. However,
player
is not used anywhere else in the class. It is not added to the world, or anything.
Background sound for the worlds
By Adi18, with 2 replies.
Last reply by Adi18, over 7 years ago:
Thanks
Getting names of objects to print for debugging purposes
By MRCampbell, with 1 reply.
Replied to by danpost, over 7 years ago:
MRCampbell wrote...
I want to get information to print to the terminal about a specific object, but I can't tell which instance of the object the information is coming from.
Introduce an indentifying field into the CatClass class: <Code Omitted>Then add a constructor to the class to accept a name: <Code Omitted>Now, you can give the cats their names: <Code Omitted>For the print line command, you can now use:
Type in player names
By marenss, with 3 replies.
Last reply by danpost, over 7 years ago:
marenss wrote...
<< Code Omitted >> What i wanted to do is to use a GreenfootImage to display the typed text. but i have no clue how to make the "name" in the method individual. My idea was to create a new object: << Code Omitted >> to do so. But i can“t figure out how to create on of this objects without giving the "text" in the code
"typed text"? where is the code that allows user input?
Problem with version 3.5.3
By MCKING91, with 2 replies.
Last reply by MCKING91, over 7 years ago:
oh thanks yes I was talking about the "Compile" button :)
Adjust position of one actor
By xandreas_1, with 2 replies.
Last reply by xandreas_1, over 7 years ago:
Thx SIr :D
Swing Timer
By TheSlorrow44, with 1 reply.
Replied to by danpost, over 7 years ago:
TheSlorrow44 wrote...
Is it a good idea to use Swing Timer? Does it affect the performance if I use it repeatedly?I use a swing timer like this: << Code Omitted
For anything to be uploaded onto the
greenfoot
site, all
javax.swing
classes should be avoided (same with
java.awt
classes). The "common way", as you put it, is more direct, works anywhere and has no chance of messing with the behavior of the
greenfoot
environment.
What does this error mean?
By TheSlorrow44, with 4 replies.
Last reply by nccb, over 7 years ago:
Are there any more lines in the stack trace? It's possible there's an error in the collision checker because it does use recursion but the stack overflow will probably involve more than three calls, so we'd need to see more of the trace. If you're willing to, zipping up the scenario and sending it to support@greenfoot.org would allow us to take a look.
Help me pls
By Himsul, with 3 replies.
Last reply by Himsul, over 7 years ago:
I tried that but it crashes. Ty anyway.
How can i create a object not permeable ?
By Thirtyseveneleven, with 1 reply.
Replied to by danpost, over 7 years ago:
In
Car
class
act
method or a method called from within the
act
method: (A_0) move car (B_0) check for collision with object(s) (B_1) if collision, move car back
Counter for lives not incrementing or decrementing.
By Notted, with 23 replies.
Last reply by Notted, over 7 years ago:
Notted wrote...
Strange. After doing a bit of debugging, I found that bombBoom never returns true; it's always false, even when the bomb hits it. Is it supposed to do that? I would like to use this for my lives system, whenever the bombs hit the boomArea (bombBoom is now true. False is when the bomb is in the air falling down.)
Just fixed it as of now. The problem was that boomBoom was being called in the act method of boomArea.
Rotation of my bullet
By Sam123123, with 1 reply.
Replied to by danpost, over 7 years ago:
Sam123123 wrote...
I added bullet code to my character but I don't know how to make my character shoot in the direction of which my character is facing. I have tried about anything on the internet but nothing seems to work. << Code Omitted >>
The rotation of your
Soldaat
actor never changes;, so
getRotation()
will always return zero at line 32.
Bullet
on line 32 is a
Class
212
213
214
215
216
217
218
X