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
greenfoot game on website
By 60sChallange, with no replies.
How can l put greenfoot game on my website?
difficulty faceing and turning a diraction
By darkspawnwolf, with 1 reply.
Replied to by danpost, over 11 years ago:
If you follow the logic of the code, you will realize where the problem is coming from. The act method starts with this: <Code Omitted>Now, assume the "w" key is pressed -- this is what happens: The first 'if' condition becomes true and the actor is rotated to 270 degrees and move up one cell. Then the second 'if' condition becomes false and the actor
Can't work out bounding boxes
By h123n, with 1 reply.
Replied to by danpost, over 11 years ago:
The Actor class has several collision checking methods available that perform in different ways. Maybe you should check out the Actor class API documentation to see what is available because 'getOneObjectAtOffset' may not be the best one to use in this case.
Counter not working (or .getCounter method error)
By NDDR, with 3 replies.
Last reply by NDDR, over 11 years ago:
It's finally fixed! Thank you very much for the fast reply and for the correcting my errors, danpost. :D
Scrolling Background
By Mrinal, with 4 replies.
Last reply by danpost, over 11 years ago:
To limit the amount of scrolling, you will need to track the amount of scrolling and then make sure any potential new value is within your set limits. It appears your world is created so that you start in the center of the scrolling area (you will be able to scroll the same amount in all directions before the limit is reached). If the scroll amounts are initialized to zero, then your limits will be at 92 and -92. For limiting a potential new value, I usually do something like this;
What seems to be the problem? Double can not be converted to boolean?
By Mach, with 1 reply.
Replied to by danpost, over 11 years ago:
In line 10, your 'if' condition is just a numerical expression. It is like saying <Code Omitted>'128.37' is not a true or false value -- it is just a number. Line 11 uses 'c.WHITE'. 'c' is already declared as a Color object. The code may execute properly as is; but, it is poor programming to use an object to get the value of a class field. Better is to just use 'Color.WHITE'. If the code is later changed and the value of 'c' is ever found to be 'null', 'c.WHITE' will throw a NullPointerException while 'Color.WHITE' will not.
How to create an on-screen user guide ?
By andreiyy12, with 1 reply.
Replied to by danpost, over 11 years ago:
This will work locally (from your system within greenfoot); but, I believe, for security reasons, it will not be allowed to work from the greenfoot site.
public int getTimer
By Jsmoove, with 3 replies.
Last reply by danpost, over 11 years ago:
The image you attempted to provide shows a 'getTimer' method in the Car class. But, you are trying to call a 'getTimer' method in the
CarWorld
class.
Piano Modified
By kmykyten17, with 4 replies.
Last reply by davmac, over 11 years ago:
Your code wouldn't compile. Here you're assigning an array to a String variable: <Code Omitted> Did you post your code again, or did you just copy from your previous post and put that between code tags? You need to post it again fully. Your first post is wrong. You can't just copy the text from it.
Help with adding actors to the world after removing them
By SB2612, with 1 reply.
Replied to by danpost, over 11 years ago:
The World class has a 'getObjects' method that returns a List object. If the List object is empty, then no instances of the Class provided were in the world.
Can I scale an image if it is not the default image for the class?
By Kendall, with 2 replies.
Last reply by danpost, over 11 years ago:
To answer the question in the title of the discussion, yes. I will use "anvil.png" as the filename of the image. <Code Omitted>Of course, the '50' that was used to reduce the image to half width and half height could be changed to any positive value.
Bullet and Score
By pr2alede, with 4 replies.
Last reply by danpost, over 11 years ago:
danpost wrote...
The code in question is your World subclass code
Please post the code in question.
planet get
By gr8n8, with 4 replies.
Last reply by gr8n8, over 11 years ago:
thank you, I love you
its giving me a incompatible types error... any fixes to this?
By Majorzack, with 9 replies.
Last reply by patterperson, over 11 years ago:
danpost please contact patterperson . I am also retired, short on money, and want to interest you in a joint project.
Enquiry
By Abanourmo, with 16 replies.
Last reply by Abanourmo, over 11 years ago:
You have helped me a lot. Thank you for your time ;-) I really appreciate your help. thank you again
599
600
601
602
603
604
605
X