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
Auto Compile Issues
By Crblakemore, with 1 reply.
Replied to by davmac, over 7 years ago:
Greenfoot should not crash regardless of auto-compilation. Can you please contact support as per
instructions on our support page
. There are no plans to allow disabling auto-compile.
Need Help
By CosmicCaleb, with 8 replies.
Last reply by davmac, over 7 years ago:
It works for a small amount of time, and then the keystrokes do not do anything. I press the keys, but the spider stops moving
Let me guess: you're using a Mac? It sounds like the problem described
here
. Try the solution there, or try using Greenfoot 3.5.0.
SpaceFighter_Skeleton.gfar
By 171828135, with 8 replies.
Last reply by danpost, over 7 years ago:
171828135 wrote...
hy guys it's me again,can you please help to make my Asteroid to float
You need to be more specific and show some attempted code. What do you mean by "float"? Would it be moving at all and, if so, how? (in detail)
Iterate through pixels
By TheGoldenProof, with 1 reply.
Replied to by danpost, over 7 years ago:
TheGoldenProof wrote...
Basically, what I need to know is what kind of list I need to make, how I can get a pixel at a location, and how I can set that pixel.
The
World
instance method
getBackground
returns a
GreenfootImage
object that contains the array you are trying to create. You can then use the
GreenfootImage
instance method
setPixelAt
to change a screen pixel by setting a color to any pixel of that image. You can acquire the
Color
object assigned to a pixel by using the
getColorAt
method on a
GreenfootImage
instance.
Reading digits of pi from a .txt file
By TheGoldenProof, with 3 replies.
Last reply by danpost, over 7 years ago:
TheGoldenProof wrote...
I don't understand what you mean by "unless you include the jar directory in the path given for the file in your code before creating the jar file." Could I put the file in the images/sounds folder and change the pathname to include the text file in the jar file?
I was just trying to point out that the root directory is different when as an executable jar file. The root is does not include the jar folder and therefore it would need to be included in your code if you were to have the txt file inside the jar folder. Whereas, when opened in greenfoot, the root in
how can i make my player jump in a different angle like 45
By Mounirmoon, with 5 replies.
Last reply by danpost, over 7 years ago:
Mounirmoon wrote...
i do not now how to make it
You will use basically the same format for jumping as for firing a bullet, tracking the state of the jumping key. You will also need to retain the horizontal direction that the jump is initiated at:
shot problem help
By Mounirmoon, with 2 replies.
Last reply by danpost, over 7 years ago:
You will never fire a bullet with the current code because you are guaranteed to use getKey method previously in either the
if (!onGround)
or its
else
part. Each time the method is called, it will return a new key or, if no key remains in the keyboard buffer, null. Also, with Greenfoot, the buffer is loaded at the beginning of each act cycle while the scenario is running, meaning that if you use the getKey method multiple times, only the one first acted on will be guaranteed to get any key. For player controlling, better is to use the
isKeyDown
Simulating a Keypress
By xtay2, with 1 reply.
Replied to by danpost, over 7 years ago:
xtay2 wrote...
Hi, i have build a game just like doodlejump. You are moving upwards in a world which is 10000 pixels high, but you have to scroll manually with your mouse to keep the camera on the player. Can I move the camera or just simulate that I use the scrollwheel on the mouse? Thx in advance xtay
Please refer to my
Scrolling Tutorial
scenario.
Removing object after some action
By sajmon1998, with 3 replies.
Last reply by danpost, over 7 years ago:
sajmon1998 wrote...
I have the assignment in which my animal(Wombat) after 50 steps must disappear. I did something like this: << Code Omitted >> And i got error: "cannot find symbol - variable Wombat". How to make this work?
If your code above is in the
Wombat
class, then use
this
instead of
Wombat
.
help me
By Jovas007, with no replies.
¿como le hago para que si un avion no atrapa en 5segundos a un cometa este cambie de posicion? HELP ME!
help me
By Jovas007, with no replies.
¿como le hago para que si un avion no atrapa en 5segundos a un cometa este cambie de posicion? HELP ME!
NEED HELP ANIMATION
By Mounirmoon, with 8 replies.
Last reply by Mounirmoon, over 7 years ago:
problems exporting to a stand alone jar file
By vbh, with 2 replies.
Last reply by vbh, over 7 years ago:
thank you :-)
Need help
By Student2394, with 2 replies.
Last reply by danpost, over 7 years ago:
Student2394 wrote...
I am trying to make a basic movement system but my if statements will not work for some reason I can only get one of the iskeydown statements running at a time << Code Omitted >>
As is, your
else
part will execute regardless of the state of the
D
key (since
else
is linked only to the
A
key part). Move line 12 to the beginning of the method and then instead of
else
, just ask if it is still
false
at line 11.
Problems using Counter in Text Actor
By KGCSTeacher, with 4 replies.
Last reply by danpost, over 7 years ago:
The same can be said for the
Good component
field. That is, the line: <Code Omitted>would need to read <Code Omitted>for the field to obtain a value and for the
getGood
method to return that object (and not
null
).
240
241
242
243
244
245
246
X