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
why should you use getOneIntersectingObject
By Jang, with 1 reply.
Replied to by danpost, 2 days ago:
Jang wrote...
i am programming a game for school at the moment aboout kollisions and as far as i know is getOneIntersectingObject important for that. But i really dont get what de benefits are. wouldnt it not just be easier to say isTouching.
Believe me. As you continue programming, you will find how useful those other collision can be. They all have there benefits (and drawbacks).
Snake game
By BenBoi, with 1 reply.
Replied to by danpost, 2 days ago:
BenBoi wrote...
I am trying to make snake, but i can't seem to get the other parts to follow correctly
Provided the parts of the snake each retain which part it follows, you only need to keep the head and the tail parts in fields. Never move the "body" of the snake. When moving, replace head with a body part and move head. Then, only if not eating, remove tail piece (the tail field needs updated first to the piece the tail follows).
how do i add delay to 1 actor?
By Fat_moose, with 1 reply.
Replied to by danpost, 2 days ago:
Fat_moose wrote...
I am trying to make a healthbar but the healthbar goes down way to fast, i tried the Greenfoot.delay() but then everything slows down. Can someone help me?
The Greenfoot.delay() method will suspend all actions for the number of act cycles given as its parameter. If the touching of another actor causes the healthbar to decrease, then it is probably true that for each act the touching occurs or continues, the healthbar will decrease. My suggestion is to list objects it touches and only decrease the healthbar when an object is added to the list (and not when the object
How would i go about making an upgrade that is continuous?
By Just_a_person847, with 1 reply.
Replied to by danpost, 2 days ago:
Just_a_person847 wrote...
Whenever the world changes, how do i make the upgrade *not* reset?
My suggestion is to use
static
fields for the upgrades. They must be initialized during your initial world constructor only. Static fields are "class fields" which do not reset when a new world is created, nor when the scenario is reset. This is why they need initialized in the initial world constructor. The keyword "static" is added to the field declaration line. For example:
HTML 5 translation error ??
By won0c, with 1 reply.
Replied to by tmhscs, 3 days ago:
Try deleting all of your import statements to awt and swing in your classes. Also try deleting lines of code like "frc = ((Graphics2D)getImage().getAwtImage().getGraphics()).getFontRenderContext();" in your Score class. I think many/all awt/swing methods and/or directly accessing AWT images have no TeaVM/HTML5 translation available which causes it to fail when uploaded to Greenfoot's website. Good luck!
How do i make a scenario
By Olivenmannen, with no replies.
I want to make a scenario but i dont know why sonce im very new here
java plugin dosent work
By tactilewaryellow, with no replies.
I have the java plugin but everytime I try to use the applet version it loads java then java gives me an error. Any ideas on how to solve this or its a permanent or server bug?
Greenfoot version without stride ??
By won0c, with no replies.
I want a Greenfoot version without stride. Please make a clean, Java-only Greenfoot!!
How to display run button ??
By won0c, with no replies.
How to display run button, reset button, and speed control slider in embedded webpage?
how to post on greenfoot??
By perfectangel, with 1 reply.
Replied to by CountyVelocity, about 2 months ago:
You share from the greenfoot editor. Use either Ctrl-E or Scenario >> Share.
Scenarios published from 3.9.0 do not work, no diagnostic
By sgparry, with 1 reply.
Replied to by nccb, 3 months ago:
Sorry for the delay in addressing this - due to travel and annual leave over the summer. I believe this is now fixed and all the scenarios which can be fixed are currently being processed to work again. (Your linked scenario has been done just as I write this.) Let us know if you spot any other problems.
Am I cooked
By no_name, with 1 reply.
Replied to by Comwp, 3 months ago:
Hey no_name, this is a pretty complicated problem but the answer is pretty straightforward. When Greenfoot resets your world instance, it recycles the JVM (Java Virtual Machine) which can annoyingly have some leftover data from previous runs. The most common way you will run out of heap space is by loading too many images. Even after an image is not attached to a Greenfoot Actor anymore (i.e. usually when the actor is removed from the world) its image is Cached by greenfoot so long as you used the method: <Code Omitted> Now, there are ways to load ima
Old versions links are broken
By sgparry, with no replies.
The links on the old versions page do not work - e.g. clicking on Windows 3.82 takes you to:
https://www.greenfoot.org/download/files/old/Greenfoot-generic-382.msi
Which does not currently work. If you manually remove the old part of the URL, the files are there:
https://www.greenfoot.org/download/files/Greenfoot-generic-382.msi
I want use a variable in multiple actors
By Afternoon, with 1 reply.
Replied to by danpost, 5 months ago:
Afternoon wrote...
I tried to make the lives variable in the world and have the actors access it from there but it doesn't work. This is my code in the World. << Code Omitted >> My goal is to have three heart actors disappear as life decreases and a player actor that decreases life when they get hit. Can someone please help?
Instead of three different
Life#
actors, try just one displaying the correct number of lives. You could start with the following:
My game is not woking exported as html
By Demiiigod, with 3 replies.
Last reply by MrParakeet25, 5 months ago:
I was able to fix the bug with my own project by uploading the game using version 3.8.2 which I archived here: https://archive.org/details/greenfoot-windows-382
1
2
3
4
X