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
Can't open preferences - Help please!
By shade882288, with 2 replies.
Last reply by nccb, about 8 years ago:
If you are still having this problem, it may be that there is an error in Greenfoot. If you contact us as described on the
support page
(especially the part about providing the debug log), we can try to work out the issue and solve it, as it sounds like a bug in Greenfoot.
Method prepare()
By gybur, with 4 replies.
Last reply by nccb, about 8 years ago:
In our menu re-organisation, Save the World was accidentally left off the top menu -- thanks for helping us notice! That will be fixed in Greenfoot 3.5.1. The option is still present in Greenfoot 3.5.0, but you can access it only by right-clicking on the world and selecting it from the popup menu there.
Back and forth movement
By DavidTshitenda, with 17 replies.
Last reply by danpost, about 8 years ago:
Explaining: <Code Omitted>
Accesing a variable or method of a world subclass
By HandsomeDodge, with 3 replies.
Last reply by Asenoju, about 8 years ago:
HandsomeDodge wrote...
Asenoju wrote...
The problem is that you wrote the "getWorld()" method right into the constructor. It's like that: First, the object is "built" (aka the constructer is called) and AFTER the object has been "built", it's added into the world. That means, by the time you call "getWorld()" there is no world your projectile is in. I suggest you to look into the "addedToWorld(World world)" method. That method is called right after an Actor has been added to the world, so you could use getWorld() in there instead of the constructor. This should fix your problem ;) Happy programmi
Movimiento ir y regresar
By Jovas007, with no replies.
Amigos,les importaria pasarme el codigo para que mi actor vaya a una cierta posicion,regresa a la inicial y nuevamente vaya a la posicion determinada,ayudaaaa
Limiting Object Spawn
By horde23242526, with 10 replies.
Last reply by danpost, about 8 years ago:
It probably has something to do with the code in your World subclass.
Scrolling World (Objects)
By Starvader, with 1 reply.
Replied to by Super_Hippo, about 8 years ago:
You have quite a lot unnecessary code in the
moveWorldRight
-method. However, it is called only once when the world is created (line 24). Instead, you need to call it repeatedly from an act method: <Code Omitted> (Btw, before posting, press Ctrl+Shift+I in Greenfoot to fix the indenting.)
Auto Compile Issues
By Crblakemore, with 1 reply.
Replied to by davmac, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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, about 8 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.
241
242
243
244
245
246
247
X