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
PLS HELP ME ;( work fine in greenfoot but unable to run with browser
By imshuenn, with 4 replies.
Last reply by imshuenn, about 3 years ago:
danpost wrote...
imshuenn wrote...
how can I assign them in world constructor rather than in their declaration lines? I have no idea about it :(
<Code Omitted>declares an
Object
reference field (w/o modifiers -- like
public
,
static
, etc). <Code Omitted>assigns a new
Object
instance of declared type to the field.
Thank you so much! I'll try it out :)
Need Help with Changing the Color of an Actor's Picture using RGB Color codes
By DatHeroAndy, with 3 replies.
Last reply by DatHeroAndy, about 3 years ago:
Nevermind, fixed that! And also thanks for the "this.getImage().fill();" line.
Hey Need help With My First Programm
By Monk_08, with 2 replies.
Last reply by Monk_08, about 3 years ago:
Thank you very much i did it :DD
Really Need Help!
By Sabszii, with 3 replies.
Last reply by danpost, about 3 years ago:
Sabszii wrote...
okay thanks, so how can i answer these two questions?
What do you think the code would look like? What have you tried?
Help in need!
By Roshan123, with 11 replies.
Last reply by Roshan123, about 3 years ago:
Thanks for cooperation! Finally it's fixed
I NEED HELP
By Tuffel, with 3 replies.
Last reply by danpost, about 3 years ago:
Tuffel wrote...
So how do i now slow it down?
Add
int
field for slow down amount (higher value, longer pause): <Code Omitted>Somewhere in codes should be control of
slowDown
value (pseudo-code): <Code Omitted>
Changing colour of text
By xixEmilyxix, with 1 reply.
Replied to by danpost, over 3 years ago:
xixEmilyxix wrote...
I was just wondering how to change the colour of the text from white to black, is there a way to do this? This is the code I have: << Code Omitted >>
You cannot change how showText displays its text. However, it does use a font (an outlined text) that will show with any background color. There is another way to accomplish what you want -- by creating the text image and either directly drawing it onto the background of the world or applying it to an actor that is added into the world. Please refer to my
Value Disp
gravity doesnt work even though code is right
By Duck12, with 5 replies.
Last reply by danpost, over 3 years ago:
Duck12 wrote...
<< Code Omitted >> this was the code to check wether my
Spieler
was on ground or not. well it works now but somehow it either floats above the wall or is inside of the wall. i changed the y offset but it doesn't seem to work. i changed everything like you said.
When landing on ground, you should adjust the y-position such that the spieler is "on", but above (not touching), the ground. Since, you cannot tell when actually landing, this will have to be constantly done when "on" ground. I have never been a fan of using an
onGround
method, myself. You can
getWidth and getHeight don't work
By alex_rimbu, with 9 replies.
Last reply by Super_Hippo, over 3 years ago:
Re-read this one:
danpost wrote...
However, it is recommended that you add these into the world thru your
MyWorld
class. General rule is that you do not create objects of a class from within its own class. (note that you
can
have an
act
method in your
MyWorld
class).
can yuh tell me what is wrong and what I am missing.
By divinity, with 22 replies.
Last reply by danpost, over 3 years ago:
You need a menu to show first and foremost. Once you get that, you will need to re-write all codes below line 28.
divinity wrote...
hi super_Hippo, I did that and I am still getting the same result
After doing this, you should at least get a menu to show up. If no menu shows, then you may need to strip it down and start with bare minimum, to build from there. Note: after each addition of new implementation, it should do what you want. That is, the program should run and the new codes should perform as wanted. In other words, work on one thing at a time; get it working properly
playing sound error
By alex_rimbu, with 2 replies.
Last reply by alex_rimbu, over 3 years ago:
That worked, thanks!
How to make an actor point towards north, south, east or west without keys?
By FunnyBoys-123, with 1 reply.
Replied to by Super_Hippo, over 3 years ago:
<Code Omitted>dx<0 moves left. dx>0 moves right. dy<0 moves up. dy>0 moves down.
HELP!
By HELP, with 5 replies.
Last reply by Gbasire, over 3 years ago:
yeah greenfoot is only for fun or to train simple coding haha
undeclared variable is.
By madalina.tuturman, with 1 reply.
Replied to by danpost, over 3 years ago:
The compiler does not know what object "is" refers to. Nor does it know of any "Touching" method (even if "is" referred to an
Actor
object). But, it does know about an "isTouching" method for an
Actor
object. Remove the "." from line 13.
Make an object move towards another object
By xixEmilyxix, with 1 reply.
Replied to by danpost, over 3 years ago:
xixEmilyxix wrote...
Imake it so that one type of bee would target an object flower and the other would only move inside a certain place (which will be the hive), I have code ... in the parent class.
Have both child classes call the
flyAround
method from their respective
act
methods, but have the one that is to stay in the hive modified to restrict where it can go and the other modified with an
if-else
to seek out flowers. A reference field for a flower actor might be useful in this regard (set it to flower when "seen" and use "if null" as condition in aforemen
55
56
57
58
59
60
61
X