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
How to allow only one instance of an object
By JamesLaa, with 3 replies.
Last reply by Super_Hippo, over 8 years ago:
Your getInstance method is missing a 'return instance;'.
Scenario opens off screen on windows 7.
By shadowrt, with no replies.
I have been working on WBC-4 on my mac. It has two screens and when I had the instructor check the code he said there was an error. I downloaded the zip file I sent him to my mac at home and it worked fine. Knowing that he uses a windows system I spun up a win7 VM and sure enough, the scenario opens off screen. Holding down the shift key and right clicking to maximize gives me a visible window but that's not a solution. I also unzipped the same file on my Ubuntu laptop and it also opened properly. Has anyone had this type of issue? My solution was to take the .java files copy into a pristine WBC-4 scenario directory on the windows system and it's fine. Since I'd like to just create my zip files for homework on my mac I would REALLY like to know what the fix is.
triangle calculator - MigLayout error
By divinity, with 8 replies.
Last reply by danpost, over 8 years ago:
divinity wrote...
how do you do that? because I am getting a lot of errors, and when I put pan.getContentPane() it is not coming up for some reason
Just add to panel -- not to content pane.
clear button, how to get it to work
By divinity, with no replies.
how can u get a clear JButton to work on a gui. I am working on the same triangle program but two different ways. I got the exit but to work but cant see to get the clear button to work. I have tried using: ClearBbtn.setText("); but is is not working properly. the word clear seem to disappear on the frame. I tried something else but is still not working. can someone help me or tell me what i did wrong. <Code Omitted>
"getWorld in class greenfoot cannot be applied to given types" error?
By Beamo, with 4 replies.
Last reply by Super_Hippo, over 8 years ago:
The problem is that if you remove the rock from the world in the checkCollision method, it won't be in the world when the checkCollisionBoundary method is executed. So you can't get the y-coordinates of the rock anymore for example. You could move line 37 to the beginning of the method.
RPG Collision
By Yoran, with 6 replies.
Last reply by Yoran, over 8 years ago:
Super_Hippo wrote...
That's the easy way without checking horizontal and vertical movement individually. <Code Omitted>
thanks Alot! this really helped me :D
How to use JavaFx Application in other classes
By selbchri, with no replies.
Hi, I tried to implement a javaFX class which extends an Application. This class runs without problems in BlueJ, but if I try to use this class as an "other class" in Greenfoot and start the javaFX Application greenfoot produces an error, also the Application Window is shown correctly. Greenfoot stops working and the Debugger shows an sun.misc.Unsafe.park. I have to restart Greenfoot to go on working. Do you have any solutions for my problem? Thanks a lot for your help.
An endless stream of... Rocks.
By Beamo, with 2 replies.
Last reply by Beamo, over 8 years ago:
OH! Thank you!!
HOW do I make it run only once?
By Williamli, with 1 reply.
Replied to by danpost, over 8 years ago:
You probably placed the line in the act method. Create a constructor for the class and move the line into it. Post the class if you need further help with this.
I'm all new. I want to know on how to make an object chase another? So this is what i got so far.
By HolkyRocky, with 1 reply.
Replied to by danpost, over 8 years ago:
If it is possible that there are no fish, then it is possible to have just one, or two, or three, or four. It is not definite that five are in the world when line 8 is executed. Line 5 only guarantees that there is at least one fish in the world. Either change '4' in line 8 to '0' or change line 5 to check the size of the list instead of checking the state of it being empty. I cannot say whether a particular fish will be "locked on" or not. It may very well be that the chaser may change targets in mid-stream (even possibly to another fish that is further away than the one it was initial
Check if it will touch wall class
By Gendut31, with 2 replies.
Last reply by Gendut31, over 8 years ago:
Super_Hippo wrote...
Something like this: <Code Omitted>
oh nice thanks, it works!
Null Pointer exception
By Alex12, with 5 replies.
Last reply by Alex12, over 8 years ago:
This is working really well. Thank you for your help. :)
Problem to a game new
By josem9507, with 2 replies.
Last reply by danpost, over 8 years ago:
Please refer to your classmates discussion thread
here
.
Problem to a game
By diablo95, with 4 replies.
Last reply by danpost, over 8 years ago:
That is probably because when they move onto an edge, they are restricted in one direction and therefore eventually (after enough times of this) find a corner where they are finally restricted by two adjacent edges. This can be avoided by unbounding the world and "mod"ing the coordinates with the dimensions of the world.
How To Make Something disappear when It hits the world edge?
By redstonespectre, with 1 reply.
Replied to by Super_Hippo, over 8 years ago:
Put it into the act method of the actor's class code which should disappear. <Code Omitted>
322
323
324
325
326
327
328
X