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
Map Game PLEASE HELP
By samuelshao, with 1 reply.
Replied to by danpost, over 6 years ago:
The resource clicking is not easy -- but would be considered easy compared to changing the color of individual countries. I think this may be too advanced for a beginner to try and tackle. However, if you still would like to proceed, I would suggest that you start by creating images of the individual countries. Maybe for each, snip a small rectangle containing the country, the fill unwanted areas (parts of the image that do not represent part of the country) with black; then change all black to transparent. What you end up with is images whose non-transparent pixels exactly represent the c
Help With Creating Several Levels and Creating A counter that continues in Different Worlds
By Happycrusher764, with 9 replies.
Last reply by danpost, over 6 years ago:
Happycrusher764 wrote...
@danpost it didnt work. Came with error message "cannot reference counter before supertype constructor has been called". What does this mean?
Alright -- try this for my line 15: <Code Omitted>
Assistance In Generalizing Code - Method
By DaRafster, with 5 replies.
Last reply by DaRafster, over 6 years ago:
danpost wrote...
Then add those parameters to the method signature and use them: <Code Omitted>
Thank you will give it a shot!
Mülltrennung/Wasteseparation
By Cool, with 11 replies.
Last reply by Cool, over 6 years ago:
I uploaded my Scenario here...
It Works!!! Tank you all so much for your help! <3
showText
By MrBradley, with 2 replies.
Last reply by danpost, over 6 years ago:
Super_Hippo wrote...
No, the showText method is only a very simple way to show text. For more advanced options, you have to draw the text with any font and color on a GreenfootImage.
... and use an
Actor
object to display it.
Location of actor
By tbag, with 1 reply.
Replied to by danpost, over 6 years ago:
tbag wrote...
How do I make an actor(A) appear where another actor(B) is located at?? and by appear I meant at the preset location of actor B and actor A must move along with actor B unless I press another key to release it.
Add a field to ActorB to hold an ActorA object: <Code Omitted>
How to reset the food when the eater was died?
By Rafiqi_Fariz, with 4 replies.
Last reply by Rafiqi_Fariz, over 6 years ago:
yeah it is working. Thank you very much danpost :)
if counter
By TakedaYeet, with 2 replies.
Last reply by danpost, over 6 years ago:
TakedaYeet wrote...
please help
Need Counter class codes (at minimum).
how do I attack an enemie nearby?
By ha2an, with 1 reply.
Replied to by danpost, over 6 years ago:
In line 37, the first expression for the
if
condition is not a
boolean
(it is a
List
object). Also, the second part will always be
true
as you are assigning that value to it and not comparing that value to it.
Inaccurate Grid of Squares?
By Gorn, with 1 reply.
Replied to by Super_Hippo, over 6 years ago:
Change line 27 to <Code Omitted> Or change it it something like this: <Code Omitted> Currently, you are filling a rectangle between (col|row) and (10|10) in the image with the size of 10×10. So the higher col and row get, the smaller the black rectangles will be. You can also move the content of the act method into the constructor.
help with a counter
By TakedaYeet, with 7 replies.
Last reply by danpost, over 6 years ago:
TakedaYeet wrote...
yes, i just dont know the code to check the amount
Will need to see
Counter
class code and scoring codes. Any code we provide now would be just pseudo-code (which I basically described above).
Continuously moving upon mouse click
By Vishnu19, with 2 replies.
Last reply by danpost, over 6 years ago:
The thing that will change is the speed of the actor (-1 or 0). So, it would make sense to use a variable for the speed and just change its value when clicked. The
move
command should not be inside the "if mouse clicks this" block of code.
Re-sizing Image
By DaRafster, with 3 replies.
Last reply by danpost, over 6 years ago:
I would start with a static int variable that contains a zoom percent value initialized at 100 (percent) and base all image sizes (and world dimensions) on it. You can then reduce its value and create a new world to resize everything. Just make sure you do not let the field value get too low (10 might be a fair minimum value). When sizing, multiply by zoom factor, then divide by 100 (<< originial size >> * zoomPercent/100).
Actor's Weapon Problem
By Rafiqi_Fariz, with 4 replies.
Last reply by Rafiqi_Fariz, over 6 years ago:
i already finish this case by myself hhh. i make new method call
fire
and use it when it is touching by the robot. Thank you for your answers
Repaint and GetRandomNumber
By ItzTigerr, with 3 replies.
Last reply by Super_Hippo, over 6 years ago:
Use this in the world’s constructor: <Code Omitted>
146
147
148
149
150
151
152
X