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
How to make a Game timer about 60 seconds which will show game over?
By Dudimus, with 14 replies.
Last reply by danpost, about 10 years ago:
Dudimus wrote...
is there any code I could type that would make the zombies' image not go on top of Chased's picture at all (hopefully solving the glitch problem)?
There is the 'setLocation' method. When touch occurs, you can use it to separate the two actors so they are not touching. But, you will need to do more to ensure that the zombie does not immediately move back into the chased and cause more lose of health before some time (your preference as to how long) has elapsed.
Exporting a project with libraries
By fejfo, with 1 reply.
Replied to by fejfo, about 10 years ago:
I solved it with a by decompiling the library a dirty solution. So I still want to know the proper solution
Need to display the time at the end
By BEASTYLAD, with 6 replies.
Last reply by BEASTYLAD, about 10 years ago:
Don't worry i used what you gave me earlier and put it into display3() THANK you very much.
Falling issues
By AuroraGamer, with 3 replies.
Last reply by Super_Hippo, about 10 years ago:
This is probably not perfect, but an example how to do it for the left side. The problem you will be facing is that if you for example walk in one direction and change the direction, the image may change a few act-cycles too late. To avoid that, you could use a field to track the current direction and if the direction is changed, you set the 't_animation' to 9, so the first image is used instantly.
Cannot see compile error messages?
By Kytuzian, with 1 reply.
Replied to by fejfo, about 10 years ago:
I think this is because the compiler doesn't now exactly what is wrong just which line and the type of mistake so it can't always give you the exact world in which the mistake was made. And you can see which type of syntact error there is on the bottom left
Don't get subclasses
By Psychpsyo, with 5 replies.
Last reply by davmac, about 10 years ago:
danpost wrote...
@davmac, should not your first line read: List<Apple> l = getObjects(
Apple.class
); ?
Yes, that's correct, sorry.
JTextField
By Luc_Stoffer, with 1 reply.
Replied to by danpost, about 10 years ago:
Luc_Stoffer wrote...
Hello everybody Does everyone know, if there is any alternative for JTextField with the same abilities just for numbers?
You can turn the numbers into text easily enough. But, maybe you are not explaining in detail enough for us to understand the real issue you are having. First, explain what you are trying to do. Then show what you have tried (include some code example). Then we can understand better what you want and can, hopefully, give you some advise, pointers, or whatever, to help fix the issue.
Inventory
By Freekywill, with 9 replies.
Last reply by lordhershey, about 10 years ago:
There are a few inventory scenarios floating around that may have shared the source.
code for pause world
By loxtn10, with 24 replies.
Last reply by loxtn10, about 10 years ago:
I started the project knowing only few things. I didnt know such tricks tp simplify my ideas. You see I learn overtime. Tip noted though. Thanks ! Cx
Trying to make the Shark chase the Crab & You Win Sign
By SkyCodes99, with 1 reply.
Replied to by danpost, about 10 years ago:
SkyCodes99 wrote...
I would like to get the shark character in my game to be smarter and actually chase the Crab.
What have you tried as far a this? If nothing, what information do you think the shark would need to accomplish this? and, what steps do you think would be involved?
Also, I would like to have a "You Win" appear after the Crab has eaten all the Worm Charcters in the game.
If the Crab has eaten all the worms, then no worms would be left in the world. Add an act method in your CrabWorld class. Have it check to see if no worms are in the world, and if so, sh
Adding a scoreboard
By LonelyCreeper, with 16 replies.
Last reply by NAMYA0303, about 10 years ago:
needs compiling
By loxtn10, with 6 replies.
Last reply by danpost, about 10 years ago:
loxtn10 wrote...
this
image
I already did, but still it doesn't work. :((
Sorry, I should have realized the code was in the Scene world class by the use of 'removeObject' and 'getObjects' without 'getWorld().' before them. See your other discussion thread.
debug need (general topic)
By loxtn10, with 2 replies.
Last reply by loxtn10, about 10 years ago:
kindly delete this discussion thanks...
need help for my school project
By Dayuyu, with 24 replies.
Last reply by danpost, about 10 years ago:
Be aware that GreenfootImage objects (as with any java.awt.Image object) is rectangular and that there may be some transparent area to any side of the visible image. These areas are still part of the image and are included during standard collision detection methods. In other words, one image is considered touching another when the images touch, regardless of whether a touching area is transparent or not. This is most likely the source of your problem here. I have created a scenario that will automatically reduce the size of an image to remove any and all excess transparencies that can be
Bug report: "Needs compile" not going away
By ellen.spertus@gmail.com, with 9 replies.
Last reply by loxtn10, about 10 years ago:
I also encounter this, this shouldn't happen the deadline of the project game is coming near, help me please
446
447
448
449
450
451
452
X