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
How to you rotate an object to face another object?
By mike123, with 10 replies.
Last reply by danpost, over 12 years ago:
Do you have a reference to an Actor named 'lorry' declared in the class? What is the code to the 'BinBump()' method?
inertia
By behappy2, with 10 replies.
Last reply by behappy2, over 12 years ago:
thx
Code
By joseph.stafford2@waldenu.edu, with 11 replies.
Last reply by behappy2, over 12 years ago:
ok, so put all the lookforsmting() stuff into eat thx
Maze Collisions Help PLEASE!!!
By gamrman, with 12 replies.
Last reply by ManiacalPenguin, over 12 years ago:
make a variable to store the x and y values of the object that you don't want to go through the maze private int x; private int y; the method to make it stop at walls is simple public void stopAtWalls() { if (getOneIntersectingObject(Wall.class) != null) { setLocation(x,y); } else { x = getX(); y = getY(); } }
Collision Detection Problem
By MrBunni, with 3 replies.
Last reply by MrBunni, over 12 years ago:
Thanks for all the suggestions, I'll go with splitting height in images since I can implement that fairly easy but is still quite good.
Pausing scenario
By Brina, with 1 reply.
Replied to by danpost, over 12 years ago:
The easiest way is to instantiate a different world that shows the title page and waits for the enter key to be pressed, when the crab world would then be instantiated.
Help for a new guy
By TheStop, with 1 reply.
Replied to by danpost, over 12 years ago:
The Java tutorials
- this page has all the links neccessary to get you on you way in learning the language. The second section on the left 'Trails Covering the Basics' is the place to start. There is also a link to the API documentation a little bit down on the right side in 'Other Resources'.
Greenfoot Documentation
- this page has links to instruction on using Greenfoot; plus links to videos and the Greenfoot API.
Real quick question
By BradH, with 1 reply.
Replied to by danpost, over 12 years ago:
Line 7 compares a class with a number. Obviously, that cannot be done; hence the error. You need to compare the number with the size of the list of items of that class that are in the world. <Code Omitted>Lines 2 and 3 are not needed at all.
Urgent help
By lonely.girl, with 26 replies.
Last reply by lonely.girl, over 12 years ago:
Thank you so much for your help :)
Actor Lives
By ctgreenfoot, with 5 replies.
Last reply by danpost, over 12 years ago:
@Peach, it might be good for you to review the Java Trail;
Learning the Java Language
. The section on 'Classes and Objects' explains how to write methods. The section 'Language Basics' has most of what you will need to get started in programming.
Little Crab 5 scenario- red worms
By Peach, with 7 replies.
Last reply by Gevater_Tod4711, over 12 years ago:
If the compiler cant find the variable wormsEaten you haven't declared it or you have declared it but somwhere (probably in an othere class) where you cant find it from your worm class. Have you got a variable wormsEaten somewhere? If yes show us the code then we can help you.
non-static methods
By Peach, with 1 reply.
Replied to by danpost, over 12 years ago:
The name of your lobster object is 'lobster2'. The class name that the object was created from is 'Lobster'. You cannot set the location of a 'class'; only an object. Try the following <Code Omitted>The line 'Lobster.setLocation(390,200);' tries to set the location of a class. The line'Lobster2.setLocation(28,546);' tries to set the location of an undefined object (Lobster2 is not lobster2 -- Java is case sensitive).
Pop up message
By Peach, with 1 reply.
Replied to by danpost, over 12 years ago:
First 'Colour' is not recognized by the compiler because you do not have a 'Colour' class that is available to it (so it then assumes it is a variable name; and since you do not declare one with that name, the error message ensues). Second, the class you want to have available to it is spelt 'Color'; and the way to make that class available is it add another 'import' statement at the top of your class code: <Code Omitted>After adding that statement, you only need correct the spelling in your code.
Adding Music to the background
By Peach, with 6 replies.
Last reply by Peach, over 12 years ago:
thank you so much!! it finally works now.
attaching objects
By BradH, with 11 replies.
Last reply by danpost, over 12 years ago:
Actually, the turnTowards method does not have to be written out either; as it is included as a method in the Actor class. Makes no sense to override it just to do what it does anyway.
900
901
902
903
904
905
906
X