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
Image stacking
By Boele009, with 1 reply.
Replied to by danpost, over 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, over 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, over 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, over 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, over 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, over 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, over 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, over 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:
Problem with atWorldEdge()
By Kolyma, with 5 replies.
Last reply by danpost, over 8 years ago:
Kolyma wrote...
I also removed the lines 27 and 28 and changed line 29 like you said.
Very good. That is what I intended.
Help
By hosfeldli, with 3 replies.
Last reply by danpost, over 8 years ago:
hosfeldli wrote...
I was trying to use get neighbor, thanks
Yeah -- the 'getNeighbours' method is more suited for grid worlds (where the cell size is greater than a single pixel).
Danpost
By Casdnova, with no replies.
Who is he, What is he, please i need a teacher, and master, Danpost if you this i want no i need your teachings in my life!
Lagging after removing objects
By ferN, with 7 replies.
Last reply by ferN, over 8 years ago:
Thank you for taking your time, I'll take your suggestions into account and update the scenario as I finish it.
Put winning image in the game
By Roel, with 1 reply.
Replied to by danpost, over 8 years ago:
Two things: (1) you can ask what level it is instead of catching an error; and (2) you should set the image before starting the delay or it will not show: <Code Omitted>
How to start a new level when certain points is reached
By TheMidget, with 1 reply.
Replied to by danpost, over 8 years ago:
<Code Omitted>Cannot be more concise with what was given.
How to check if a player is in a world?
By sadiebean00, with 2 replies.
Last reply by sadiebean00, over 8 years ago:
Thank you this works :)
282
283
284
285
286
287
288
X