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
Dam
By EdwardGaming, with no replies.
Lot's of help needed with stuff.
help
By Nep, with 2 replies.
Last reply by danpost, over 4 years ago:
Nep wrote...
How to set an object to 20 pixels from the right and 100 from the top of the World.
20 pixels from right would be width of world minus 20 (the
World
instance method
getWidth()
would be used). 100 from the top is just
100
(nothing more is needed).
Make y increase by 40 pixels in a vertical line?
Using While Loop
Are those instructions given??? A
while
loop would execute in entirety within one act cycle. The actor would teleport directly to its intended ending location unless you make use of the
Greenfoot
I need help with pausing an actor
By Tuffel, with 4 replies.
Last reply by danpost, over 4 years ago:
Tuffel wrote...
so everytime i want to pause the act, i have write this thing: if (pauseTimer > 0 && --pauseTimer > 0) return; ; and if i want to pause him another time with a different amnout of time, can i just change th int (here pauseTimer) to like PauseTimer? Tysm for the help, appreciated:)
To be clear, <Code Omitted>as the first line in the
act
method only sets up the pausing (allows the behavior). Pausing is initiated by assigning a positive value to
pauseTimer
:
PLS HELP ME ;( work fine in greenfoot but unable to run with browser
By imshuenn, with 4 replies.
Last reply by imshuenn, over 4 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, over 4 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, over 4 years ago:
Thank you very much i did it :DD
Really Need Help!
By Sabszii, with 3 replies.
Last reply by danpost, over 4 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, over 4 years ago:
Thanks for cooperation! Finally it's fixed
I NEED HELP
By Tuffel, with 3 replies.
Last reply by danpost, over 4 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 4 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 4 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 4 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 4 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 4 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 4 years ago:
<Code Omitted>dx<0 moves left. dx>0 moves right. dy<0 moves up. dy>0 moves down.
61
62
63
64
65
66
67
X