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
Need help with enemy self-stunning (like getting tired)
By iminblue, with 21 replies.
Last reply by iminblue, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 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, almost 8 years ago:
This is literally what I was asking for. Thank you.
ThreadAct / Update
By MrBradley, with no replies.
Davin, I've returned to ThreadAct after doing some work on my own, and I was wondering if you might like to work with me on updating it to use a MessagePump approach vs an array of sequences. I have a similar scenario where each actor places action messages (sequences) into a message queue, and has an associated thread that executes it and relinquishes control. The message queue is implemented using a BlockingQueue, and I was thinking of setting its size to one (1) and have that auto block until the next message appears in the queue. Another revision would be to use Functional Interfaces and lambdas for each action sequence (doRun). Let me know. Cheers
Place object relative to window
By benja24, with 5 replies.
Last reply by benja24, almost 8 years ago:
The menu shows information, i. e. polpulation and resources (stored as fields in the city that was clicked) and has some buttons to change those fields. I wasn't planning on uploading the project so a JFrame sounds like a interesting solution... Thank you!
What is this problem about? how to fix it?
By agiastaee, with 2 replies.
Last reply by danpost, almost 8 years ago:
Apparently, you make reference to a class named 'Title' that does not exist. You need to either create a new class with that name or remove the reference.
299
300
301
302
303
304
305
X