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
Wombats and Leaves Edge of World
By FreeBobby2020, with 1 reply.
Replied to by danpost, almost 7 years ago:
The wombat is not coded to move away from the edge of the world once it is arrived at. So, any leaves remaining in the interior of the world will not then be found.
Wombats and Leaves Question
By Biscuits1, with 3 replies.
Last reply by danpost, almost 7 years ago:
First, the
act
method will have the wombat do one of 3 things. In order, it will either (1) eat; (2) move or (3) turn (see lines 24 through 32). In order to move, the returned value of
canMove
must be
true
(lines 27 through 29, specifically). The
canMove
method returns
true
only if the wombat is not facing a wall. As previously mentioned, if the wombat does not move, it will turn (left, specifically). Therefore, once the wombat finds an edge, it will turn to move counter-clockwise along the edges of the world.
Greenfoot Rectangle
By utsabdahal, with 1 reply.
Replied to by danpost, almost 7 years ago:
utsabdahal wrote...
code for making a wall of rectangle please.
First create a subclass of
Actor
and give it an image or have it create one. In you run into problems with your code, then post what you ended up with for help.
GIF frames overlap
By AndreiTheMagic, with 2 replies.
Last reply by nccb, almost 7 years ago:
We did have a bug in the GifImage class which meant that certain GIFs did not clear their image properly between frames. This is fixed in Greenfoot 3.5.3 -- you'll need to install the new version, delete the GifImage class in your scenario, and re-add it via the Import Class functionality. That should hopefully fix the issue.
Wombats and Leaves
By blue_murph47, with 1 reply.
Replied to by danpost, almost 7 years ago:
blue_murph47 wrote...
In the Wombats and Leaves game, I had placed 13 Wombats and 3 leaves, after I let it run, it appears there are only 8 Wombats running in the circle after they are done eating. Why did this happen?
Try stopping the scenario and mouse drag each wombat.around.
wombats
By eagles5218, with 1 reply.
Replied to by danpost, almost 7 years ago:
eagles5218 wrote...
why do the wombats not eat all the leaves and just go in a circle
You will need to show the Wombat class code that goes with this question.
Can somebody tell me if this is good?
By Claw76, with 1 reply.
Replied to by danpost, almost 7 years ago:
Claw76 wrote...
This is my idea for a Button class and I wanted to know if it is a good idea. I saw some ideas how to create Buttons, but nobody never really came up with a solution like this (as far as I know). However, I also wanted to know if there are improvements that could be made and if there is a way that the Button class doesn't need to inherit from the Actor class. Please reply. This is the code from the Button class: << Code Omitted >>
As far as inheriting Actor, you will need an
Actor
object to display the button in greenfoot unless you modify the background image o
Help with this code.
By WhiteSorcerer03, with 12 replies.
Last reply by danpost, almost 7 years ago:
When I said:
Right click on the boy and select '
Inspect
'. Do the values appear to be okay, or is something off?
you responded with
No it seems to be fine.
Did you not see a bunch of
null
values (for the images)? Would that not seem off?
Score is not increasing when I pickup a coin
By denizkb, with 1 reply.
Replied to by Claw76, almost 7 years ago:
<Code Omitted>This is the code I came up with, when seeing your project and your problem. You need to put it into the sprite class I hope it will help you. (I didn't test it)
Turn towards mouse help
By 343qwm29, with 1 reply.
Replied to by Claw76, almost 7 years ago:
<Code Omitted>Hey 343qwm29, I hope this line of code will help you... A little hint: When you don't know how to do something, but you have an idea what your code has to do, go to your Greenfoot Scenario and click on "Help" and then on "Greenfoot Class Documentation" where you can find almost every method that Greenfoot has, and how to use it.
Object should know which objects another object touches
By Kilian, with no replies.
I want that my object trefferpunkte changes the value of a private int variable when the ball which is touching trefferpunkte is touching a patrone.
Music Doubles Over On Restart
By ErnieBoi, with 2 replies.
Last reply by ErnieBoi, almost 7 years ago:
danpost wrote...
Try starting line 17 in the Maps class with the word
static
.
OH THANK YOU DANPOST I HAVE BEEN ILL AND HAVE NOT BEEN AT FULL CAPACITY TEE HEEEE, I AM ERNIE AND I LOVE YOU SO HERE, AS A GIFT FROM ERNIE TO DANPOST HAVE A SEXY NUDE U NAUGHTY BOY.
░░░░░▄▀▓▓▄██████▄░░░ ░░░░▄█▄█▀░░▄░▄░█▀░░░ ░░░▄▀░██▄░░▀░▀░▀▄░░░ ░░░▀▄░░▀░▄█▄▄░░▄█▄░░ ░░░░░▀█▄▄░░▀▀▀█▀░░░░ ░░▄▄▓▀▀░░░░░░░▒▒▒▀▀▀▓▄░ ░▐▓▒░░▒▒▒▒▒▒▒▒▒░▒▒▒▒▒▒▓ ░▐▓░█░░░░░░░░▄░░░░░░░░█░ ░▐▓░█░░░(◐)░░▄█▄░░(◐)░░░█ ░▐▓░░▀█▄▄▄▄█▀░▀█▄▄▄▄█▀░
Leaderboard bug
By ant, with 3 replies.
Last reply by danpost, almost 7 years ago:
When you move a value in your arraylist, you destroy what was previously in the position you set. Change line 88 in HighScores class to: <Code Omitted>
I am trying that an object removes an object which is touchung another Object???
By Kili, with 1 reply.
Replied to by danpost, almost 7 years ago:
A method with protected access can only be executed on '
this
', which is implicitly understood if no object is explicitly given to execute the method on. That being said, to use
isTouching
on a
ball
object, it must be coded in the
ball
class. You can add a
public
method that returns a
boolean
value depending on the touching state in the
ball
class and call it from the other class.
I am trying to make the enemy hinder dissapear after a multiple hits. This code doesn't even remove the Enemy.??
By JoNGrEeNfOoT, with 10 replies.
Last reply by danpost, almost 7 years ago:
JoNGrEeNfOoT wrote...
Then I called the method in my public void act! if(getWorld() != null)destroyHinder();
That should work.
215
216
217
218
219
220
221
X