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
Level Progression
By SymInvader, with 13 replies.
Last reply by SymInvader, about 7 years ago:
I just figured out the problem and it's all resolved now. The last thing I need to help with now is the high score system, because every test where I score higher than the last high score, it still doesn't change. Putting in the code for the high score below, and below that, the code for it to display. Hope somebody replies soon. Thanks!
EMERGENCY, ASSIGNMENT DUE TOMORROW
By Chelseayxz, with 1 reply.
Replied to by Chelseayxz, about 7 years ago:
Nevermind! problem solved!
Help With Droppable Characters from a menu.
By JordiC, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
I am not sure how I would do it. There are several ways. For example: -- Have one class for the plants. No matter if they are shooting, dragged to a possible position or in the menu. Have a variable to track what it is doing right now and act accordingly. So have it start at 0 (=in menu). When clicked, add a copy with 1. At 1, follow the mouse. If clicked at a possible position, "drop" it, set the variable to 2. If at 2, shoot, react to being attacked… -- Have one class for the plant in the menu (menuPlant) and one for the plant on the field (fieldPlant). The world handles which object in
World not being able to walk everywhere
By loldertroll, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
Hm, I think the best way would be to move and then call a method on the active world and check if the character is in a cell which is allowed. If not, move it back to where it was.
dashing
By loldertroll, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
What is a dash?
I'm having trouble keeping the same score across different levels
By Dan143, with 30 replies.
Last reply by AmyIsBadAtCoding, about 7 years ago:
This is my code. The reason why I have been using this thread because I've genuinely been told off for making different threads when others have similar issues by who I think was a mod lmao. Here's my code, this has the change world code in:
guys whats wrong? help
By loldertroll, with 2 replies.
Last reply by loldertroll, about 7 years ago:
ty
GreenFoot Coding Question
By DrakeGuo, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
You use it after every command. For example: <Code Omitted>
Making an Object Disappear When Clicked Using Coordinates
By rb6333, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
When the mouse was pressed, you can get the current location of the mouse with the use of the MouseInfo object. Then you can either check if the mouse X and Y coordinates are between xMin/xMax and yMin/yMax (if cellsize>1 at least) and remove your object then. Or you move an invisible helper object to the position of the mouse, get a list of all object in a small range with the getObjectsInRange method and if your object is one of them, remove it. (To see the methods and how they are used, visit the API with this link
https://www.greenfoot.org/files/javadoc/
or by double clicki
Greenfoot Question
By iLoveSko0l123, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
It is just there so you can see which is which easier. You can also change those colors or remove them completely. For background: Green is code for classes, yellow for methods, red for loops and blue for any other code blocks such as "if". White is the rest. For code itself: variable types (int, bytes, also return type void) and class/extends/... are red, some keywords (this, null, …) are blue, others (instanceof) are yellow. Access modifiers (private, public, …) are purple. Comments are blue or gray and the rest is black.
Hide Mouse Cursor
By Xevinaly, with 4 replies.
Last reply by danpost, about 7 years ago:
Super_Hippo wrote...
I was importing all that when I got it from somewhere... << Code Omitted >> Well, I don't really know how it worked. I only know that it is the scenario I can't get a HTML5 translation for even after removing it.
Okay -- yes. The
WorldCanvas
object was a
JPanel
object (a swing object) acquired via the
WorldHandler
object. The
Cursor
and
Toolkit
classes are both part of the
java.awt
package. I am not even sure if it is possible to acquire the world canvas in the later versions of greenfoot to begin with.
Problems with an Actor touching one of their subclasses
By loldertroll, with 3 replies.
Last reply by AdiBak, about 7 years ago:
You could try this: Actor
variable name
= (
subclass name
) getOneIntersectingObject(
subclass name
.class);
Cannot find variable 'counter'
By AmyIsBadAtCoding, with 3 replies.
Last reply by CreatorMoon, about 7 years ago:
See, that's what I'm trying to do.
How to change font size and colour?
By CreatorMoon, with 6 replies.
Last reply by CreatorMoon, about 7 years ago:
Thanks. I hope to use this next time.
End turn code not working
By excitedbubbles, with 4 replies.
Last reply by danpost, about 7 years ago:
There should be no problems with using
isKeyDown
here. However, best would be to control turn phase in your
World
subclass, not only because it is a function of the game itself (not the individual players), but also because you will only require one field instead of two.
184
185
186
187
188
189
190
X