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
java.lang.NullPointerException
By HMH, with 4 replies.
Last reply by Super_Hippo, almost 8 years ago:
Assigning a new Punktestand object to the Punkt variable still doesn't make it the one in the world, it is a new object as the world new tells you. There are a lot of ways to do it: - get a reference at runtime (only working if there is always one Punktestand object in the world: <Code Omitted> - pass a reference to the Spieler object upon creation
How to use this
By hosfeldli, with 11 replies.
Last reply by hosfeldli, almost 8 years ago:
That fixed it thank you
Trouble making actor appear and disappear dynamically
By Justins9269, with 13 replies.
Last reply by danpost, almost 8 years ago:
You could make all your worlds extend a single subclass of World and put the method there so Lucas can find it easily from any world.
Move another actor when another mouse is pressed on actor!
By LaurentiuRohan, with no replies.
Helo everyone, I have three actors in my world. Circle MoveLeft, Circle MoveRight, Puppy Player. I want that when mouse is pressed on the Cirlc MoveLeft Puppy player moves to the left when CircleMoveRight puppy moves to the right. How could I do that?This is the code for my Puppy Player. <Code Omitted>
I need help for my schoolproject! Without this problem it would be finished! Thank You!
By Lasklu, with 6 replies.
Last reply by Lasklu, almost 8 years ago:
Yes davmac and danpost I am very sorry for my fault. I did not exactly tramslated everything of the text which I received. Firstly I thought the was only an error with my account. But after the fourth time I have read it exactly and i understood the message. This will not happen again.I´m sorry for that! What I wanted to write was that I have uploaded my project on greenfoot. This is the link: http://www.greenfoot.org/scenarios/20962 . It would be amazing if you could help despite this aggravting and bad mistake on my side!
Convert Greenfoot Games
By LaurentiuRohan, with 2 replies.
Last reply by Yehuda, almost 8 years ago:
Look at
this discussion
, and the link mentioned in it.
HELP! Making an object turn at a certain set of coordinates.
By aidanbbbb, with 1 reply.
Replied to by danpost, almost 8 years ago:
aidanbbbb wrote...
How do I make an object turn once it reaches a certain set of coordinates. If statement please!
Example code given (for use in act method in class of object): <Code Omitted>
Image stacking
By Boele009, with 1 reply.
Replied to by danpost, almost 8 years ago:
The World class provides a method to force the painting of one type object over another. Please refer to
it.
Getting Rid of actors
By Heet_Patel, with 25 replies.
Last reply by danpost, almost 8 years ago:
I found the problem. Do the following in the GameOver class: <Code Omitted>The act method will not run if the scenario is stopped. The image must be given beforehand (when the object is created and, in this case, before being placed into the world).
Gold Income
By Lavenger, with 40 replies.
Last reply by CubeGamer6, almost 8 years ago:
Lavenger wrote...
Thank you very much ^^ I'm going to sleep for now and work on this project tomorrow... It's 02:28 am here and I have been coding around this project since 17:30pm @-@ Thank you danpost, CubeGamer6 and Hippo for teaching and guiding me through this ^^
No problem! :)
getoneobjectatoffset
By ZiweZhang, with 5 replies.
Last reply by ZiweZhang, almost 8 years ago:
thank you
Game Crashing When Class Goes Out of The World Even Though It's Set To Delete It When It Reaches The Edge
By SchoolCoder38, with 2 replies.
Last reply by SchoolCoder38, almost 8 years ago:
Thank you very much! This worked great and now my game is finished!
danpost wrote...
You cannot move an arrow if it is removed from the world. As well, you cannot check for an intersecting target after the arrow is removed from the world. And how about the other two edges (bottom and left) -- I would think the arrow would be removed if reaching either of them also. Instead of the 'removeTheArrow' method, maybe you can use 'isAtEdge' and concatenate the possible conditions for removal into one statement:
java.lang.IllegalStateException
By Kolyma, with 2 replies.
Last reply by danpost, almost 8 years ago:
Also, remove line 22.
Yehuda wrote...
Move the if-statement that removes the Actor from the World, to be the last part of the act method.
Or, insert the following line after line 17: <Code Omitted>
Scaling Images
By Agent40, with 10 replies.
Last reply by danpost, almost 8 years ago:
Sorry, 'LengthOfAnimation' was supposed to be 'Image' in both lines 1 and 3.
Testing Act() Method
By tonym840, with 2 replies.
Last reply by danpost, almost 8 years ago:
What is this: <Code Omitted>The
java.util.Random
class does not have any method with the name 'generator' ('static' or otherwise). It does have a 'nextBoolean' method; but, you would need to call that on a Random object -- not on the class: <Code Omitted>However, you can just as well do something like this:
280
281
282
283
284
285
286
X