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
Get nearest Object
By ds06, with 14 replies.
Last reply by ds06, almost 11 years ago:
Oddly, this works now too :D Maybe i misspelled. Thanks again for your help!
Question about Greenfoot
By rrose5, with 1 reply.
Replied to by danpost, almost 11 years ago:
This page
of the Java tutorials might help.
HELP PLEASE
By beliuga, with 3 replies.
Last reply by danpost, almost 11 years ago:
Again, I cannot tell where this act method is with it by itself like that. I will say this much, however. It appears you are trying to create and start a new world by changing the background image of the first world. If you are, it is not done that way. It would still be the first world with a different background image; and, the constructor of the second world would never be executed. You need to use 'new background2()' to create a 'background2' world. You can create and set one active using 'Greenfoot.setWorld(new background2());'.
Help with an error? (Illegal start of expression)
By Bluephoenix14, with 3 replies.
Last reply by hhoogerwerf, almost 11 years ago:
nevermind I didn't see he wanted to start a new method. I thought he wanted to make a boolean my bad.
2 if() at the same time?
By xFabi, with no replies.
Edit: Fk it, right after i posted this, i got my solution, omg sorry :D
Increase heap space
By Nicotinamidadendiniukleotid, with 1 reply.
Replied to by danpost, almost 11 years ago:
You could size down the pictures and only show every other picture. This would reduce the load on the heap space dramatically. At a size of (400x300px) showing only half the pictures, you will reduce the load by over 87 percent.
Constructors not working right way
By berdie, with 3 replies.
Last reply by danpost, almost 11 years ago:
berdie wrote...
That´s not the problem :S
I think that it is indeed the problem (although, it could possibly be something else. Remove 'images/' from the filenames in the 'setImage' lines (unless you have a folder called 'images'
inside
the 'images' folder in your project directory. On the other hand, you did not mention any exception throws or error messages which leads me to believe that either you are not being very helpful in describing your problems or something else is creating the problem to begin with.
Dragging an object to a certain destination? Help
By AnthonioBanderas, with 6 replies.
Last reply by AnthonioBanderas, almost 11 years ago:
danpost wrote...
Well, it does not have to be a method, as I said before. You can just set the value depending on the current conditions at the line I placed the call to that 'imaginary' method; however, if you wanted to make a method of it, that would be fine (that is, it would run the same). The method, if you went ahead and wrote it would be like this: <Code Omitted>Basically, this is line 12 of the code Super_Hippo provided.
help!
By motyamer, with 1 reply.
Replied to by danpost, almost 11 years ago:
Show what you tried so we can help fix it.
HELP!
By KR0N0S, with 1 reply.
Replied to by danpost, almost 11 years ago:
That would depend on how you move the actor to begin with. Post the class code of the actor (use the 'code' link below the reply box to insert code into your posts).
using a for loop with actors
By hhoogerwerf, with 9 replies.
Last reply by hhoogerwerf, almost 11 years ago:
I will change it after I finish my code, I still need to code that bit. So for now I use 1==1. Just to check if the code works.
NullPointerException with getObjectAtOffset
By ds06, with 11 replies.
Last reply by danpost, almost 11 years ago:
BTW, if both of the objects (the Held object and the Gegner1 object) are fixed at their initial locations in the world, then you can just use (50, 0).
Change if...else if in switch
By Mariachi, with 7 replies.
Last reply by Mariachi, almost 11 years ago:
I understand thank you !
Add general functions to World()
By Nicotinamidadendiniukleotid, with 1 reply.
Replied to by Nicotinamidadendiniukleotid, almost 11 years ago:
Ahh I fixed it. Here's the solution: Constructor: <Code Omitted>and click: <Code Omitted>
How to spawn multiple objects with delay
By AnthonioBanderas, with 6 replies.
Last reply by AnthonioBanderas, almost 11 years ago:
danpost wrote...
AnthonioBanderas wrote...
Ok thank you, but the CheckSpawning is already there in the PortWorld act as you see in the 2nd code, right?
No. Not right. The checkSpawning method is being called from the constructor of the class, not the act method. At the moment, the act method of your PortWorld class is empty (inherited from the World class; see the documentation). You need to override it and call checkSpawning from it in your PortWorld class.
Thank you so much. It works now
619
620
621
622
623
624
625
X