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
Shooting
By Lildarkone, with 3 replies.
Last reply by Lildarkone, over 13 years ago:
Nevermind, collision with world edge is working now. Thanks again for the arrow movement!
Mouse Wheel and Image
By PiRocks, with 3 replies.
Last reply by Builderboy2005, over 13 years ago:
Ah, fixed it. I needed to add it into the world panel by using: WorldHandler.getInstance().getWorldCanvas().addMouseWheelListener(myScrollingListener);
Sun Beams
By webmessia, with 3 replies.
Last reply by JL235, over 13 years ago:
webmessia wrote...
Method 2) Create an array of GreenfootImages for frames(15 at the moment). Then draw the sky on each one, aswell as the sun beams rotated slightly each time. Then draw the grass on each one. This is done once at construction, then the images are looped through when running. Pros: Fast. 30fps+ easily Cons: Lots of memory needed. over 100MB I think. I kept on getting Java Heap space errors after a few compiles. Seems to have less memory problems exported. Is there anyway to reduce the ammount of memory the images take up?
This is quite an advanced part of Java to u
Strange Glitch
By srk0008, with 1 reply.
Replied to by nccb, over 13 years ago:
Could you zip up your code and send it to support@greenfoot.org, so that we can take a look? And do the machines that you were trying to run the code on have different versions of Greenfoot?
error when uploading
By Johnny5, with 2 replies.
Last reply by davmac, over 13 years ago:
I have no trouble uploading. Has this been fixed in the meantime?
Greenfoot Linked list?
By Mattan.H, with 1 reply.
Replied to by JL235, over 13 years ago:
In Greenfoot you can use the Java API. In there are
LinkedList
and
ArrayList
classes you can use. Personally I'd recommend using the latter.
Removing Object at height of parabola?
By Wes1731, with 2 replies.
Last reply by PiRocks, over 13 years ago:
If your parabola is quadratic (ax^2 + bx + c), then the top of the parabola is in the exact middle of the two solutions. Since you're in highschool, I'm going to assume you know how to do this. If you are using the same parabola every time, you can pre-calculate this point, otherwise you should probably use the quadratic formula and calculate the point before the object is launched because the game might lag during the calculation.
Optional Start/Reset
By Builderboy2005, with 5 replies.
Last reply by Builderboy2005, over 13 years ago:
Ah gotcha, the reason I ask is merely because the website WeCreateStuff.com has taken an interest in my Nightmare Scenario, and I aim to release it on their website as well as Greenfoot when it is finished, and I was just looking for a way to remove those buttons, but it's not really a high priority right now :P
Right mouse button broke
By coirby3, with 1 reply.
Replied to by JL235, over 13 years ago:
Ultimately your just going to have to buy a new mouse. However until then one of the main things you won't be able to do is to create sub-classes of Actor and World. In the top menu bar you can create a new class from there and then alter it's class signature adding 'extends Actor' or 'extends World'.
scroll bar in executable jar
By davidlewine, with 2 replies.
Last reply by davmac, over 13 years ago:
davidlewine, look at the greenfoot.export.GreenfootScenarioViewer class. You might turn the center panel into a JScrollPane for instance. MathManiac: I think the question is about Greenfoot's own code, not about how to create a scroll bar generally.
Save best point
By egenius, with 15 replies.
Last reply by davmac, over 13 years ago:
MathManiac, you are incorrect. What I said was slightly inaccurate, but not in the way you describe, and only if you take it out of context. To be completely accurate, the
new File(...)
expression doesn't actually open a file at all. Opening the file only happens when you try to create an input or output stream/reader on the file; and, if you create a
FileReader
as in your own example, the file must exist. It is not true that an empty file is created in that case.
Gamepad error
By Conor, with 1 reply.
Replied to by MathManiac, over 13 years ago:
It will be better if you place in your source code, because the Error log doesn't seem real. I don't know if you created a try/catch block for the log to say that.
Get coordinates from world and put it an actor class?
By The_Mac, with 2 replies.
Last reply by MathManiac, over 13 years ago:
<Code Omitted> <Code Omitted> Put the first piece of code in your Actor, and the second piece in the World.
Windows 7 - Java Error if "open" or "save" projects
By DavidH., with 4 replies.
Last reply by MathManiac, over 13 years ago:
JL235 wrote...
Greenfoot requires Java 6 to run fully. Java 5 is pretty old now and also doesn't fully support Windows Vista and 7 (certain GUI elements are drawn incorrectly). But still try upgrading to the latest version of the JDK as it could be a Java bug that has since been fixed.
Never heared of it. I'll try installing it.
Ending a Game
By moekler, with 1 reply.
Replied to by JL235, over 13 years ago:
You can achieve that by using some boolean flags, and getting the number of actors in the world. For example...
1049
1050
1051
1052
1053
1054
X