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 create a score counter in greenfoot?
By brianfu, with 3 replies.
Last reply by danpost, about 8 years ago:
mert2727 wrote...
look at this :D https://www.youtube.com/watch?v=VnR6i7BXD-E
That link shows how to make a score counter; but, that is not the issue here (thanks for trying to help, anyway). The issue here was coming up with a condition that will satisfy the particular needs of this game for scoring:
brianfu wrote...
I want to add 1 to the score counter when my character jumps over an obstacle. But
I don't know what the condition will be
. please help me!!!
I made a scenario public and I would like help to solve a problem in it
By protocolUnknown, with 13 replies.
Last reply by danpost, about 8 years ago:
protocolUnknown wrote...
Wait a minute for your first patch of code that you posted above: < Code Omitted > ^Is that to maximise randomisation?
That segment so that each and every item, including duplicates, listed has an equal chance of being selected. As each item is selected, it is removed from the selectable items before the next choice. Added more documentation below:
Easy counter code
By MisterJ, with 2 replies.
Last reply by xbLank, about 8 years ago:
I agree. I don't even bother reading through a mess of plain text when using code tags is so simple.
Need help with enemy self-stunning (like getting tired)
By iminblue, with 21 replies.
Last reply by iminblue, about 8 years ago:
iminblue wrote...
Actually is does work but the level starts with the Minotaur being stunned . Can I initialize the stunTimer with the GreenfootRandomNumber-thing before public void act?
Oh nevermind I made it work. Thank you very much guys for helping me with this one I appreciate it . Have a good day !
How to swich lenght values in greenfoot? (dx and dy)
By omnix, with 3 replies.
Last reply by danpost, about 8 years ago:
Doing what Yehuda suggests will have the discs reversing directions. This will not be visually appealing as discs bounce off one another. Having the discs exchange their direction values might be a little better, but still will not appear to be a normal bounce. To create a real looking bounce, the size of the discs, as well as direction and speed, and their world locations at the time the bounce occurs must all be taken into account. It gets quite complicated. From what you wrote above:
omnix wrote...
my teacher has explained me that I should swich the dx and dy values which stands for the
Fullscreen Removal
By Cirion, with 2 replies.
Last reply by Yehuda, about 8 years ago:
Also, change line 26 to: <Code Omitted>Unless MyWorld is the name of a MouseInfo subclass.
Help me pls
By cornivus, with 1 reply.
Replied to by danpost, about 8 years ago:
Remove the following import lines: <Code Omitted>
setLocation
By MrBradley, with no replies.
I am trying to implement a snap to grid only when actors are being dragged within the world via the GF UI. Is there a flag that indicates this? Otherwise all movements get snapped to grid... Thanks.
Help me pls
By cornivus, with 1 reply.
Replied to by danpost, about 8 years ago:
Please use image name on site -- not just site name. That is, the link need to end with the image file format extension (usually ".png", ".jpg" -- aka ".jpeg" -- or ".gif").
Actor Spawning
By EmilinaZombie, with 2 replies.
Last reply by EmilinaZombie, about 8 years ago:
Thank you! I'll check it out!
How do you put a single actor at the top of the world's paintOrder?
By CubeGamer6, with 1 reply.
Replied to by danpost, about 8 years ago:
CubeGamer6 wrote...
I was thinking that there was some method like<Code Omitted>but i couldn't find anything. what i want is like with Windows where you have a multiple windows on top of each other, and you can focus on one specific window just by clicking on it.
You might, at least for now, get away with using some undocumented behavior where actors of a class are currently painted in the order they were added into the world (where the last one added is painted last -- or on top of the others). So, to have one moved to on top of others, save the world and
Constructor Overloading
By xbLank, with 5 replies.
Last reply by xbLank, about 8 years ago:
Hmmm.. thats weird. Thank you tho!
How to make something happen the 1st time the world spawns in
By Bandito, with 3 replies.
Last reply by Bandito, about 8 years ago:
That seemed to work thanks for your help as always!
Is the order of adding and removing similar Actors at the same location deterministic?
By MrBradley, with 7 replies.
Last reply by MrBradley, about 8 years ago:
One Solution: To close this topic off for others who might be interested, I have taken the following approach: For an Actor you would like to impose an order on, use a serial # or ID field assigned by incrementing a static field. Change GF method call from getOneObjectAt(...) to getObjectsAt(...) Cycle through each element looking for the one with the largest (or smallest depending on removal order) ID, then use/remove that one. Thanks to both Dan and Davin for their suggestions.
Return Actor Name/Count
By xbLank, with 7 replies.
Last reply by xbLank, about 8 years ago:
This is literally what I was asking for. Thank you.
299
300
301
302
303
304
305
X