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
My Score Is Not Incrementing When I Pickup A Coin
By denizkb, with 6 replies.
Last reply by denizkb, over 7 years ago:
danpost wrote...
denizkb wrote...
<< Code Omitted >> This is MyWorld code if that helps. I am still stuck and the score is not incrementing ;/
Change line 132 to: <Code Omitted>and line 150 to <Code Omitted>If problem persist, show sprite class next.
Thank you so much, the score now increments whenever I collect a coin. I would kindly like to ask if you could help me with the lives counter:
https://www.greenfoot.org/topics/61747/0#post_130426
error message can't open scenario
By g.baessler, with 1 reply.
Replied to by danpost, over 7 years ago:
g.baessler wrote...
The world could not be constructed. The world subclass may not have a public constructor without parameters, or may not be public
Obviously there is something amiss with your World subclass code. Show code for help.
I struggle with giving my actor reversed controls
By Tommes, with 2 replies.
Last reply by Tommes, over 7 years ago:
Thank you! You helped me a lot!
Compile button not appearing on interface
By TinaFields, with 1 reply.
Replied to by danpost, over 7 years ago:
TinaFields wrote...
Why does my interface not have a compile button on the bottom right?
Greenfoot now auto-compiles. Any time you change your code, it will compile your project if no errors when detected during the changing of the code when you go back to the main scenario frame,
Control Redirection to Multiple Worlds with One Method.
By Lewis12374, with 1 reply.
Replied to by danpost, over 7 years ago:
Lewis12374 wrote...
I'm trying to achieve making my menu as abstract as possible, but I cannot seem to find a way around doing so. This is what I have tried so far, with no progression. Please help? << Code Omitted >> The error received is: '(' or '' expected on the SuperClass.
The compiler is expecting a class name followed by a parameter list (a set of round parentheses that may or may not contain any elements). It has yet to complain that you use a String object for the name or that it cannot find a class named "HelpScreen" (including the quotes) -- I suspect it will do one or th
Image
By Adi18, with 5 replies.
Last reply by danpost, over 7 years ago:
Adi18 wrote...
Thanks. That could be a problem because I want to do something like a character can only jump to the top of the image, but if it touches the left, right or down side is put aside
For that, all you really need to know is the direction that the character moved. For example, if moved right and touches the object, then the object is to the right. Same goes for the other directions. As long as you adjust the position of the character such that it no longer touches the object (moving opposite the initial direction moved), you should not have any issues.
How can you keep variables between worlds
By iminblue, with 21 replies.
Last reply by iminblue, over 7 years ago:
danpost wrote...
iminblue wrote...
I did it just as you said : addPlayer is in the World's code , and I try to call it from a method inside the Player class : << Code Omitted >> Using this directly in the act() method doesn't work either.
In line 3, you are trying to call
addPlayer
on an object of type
Class
(called
yeet2
). This will not work -- you cannot add a player to a class; you can only add a player to an object of type World (or, in your case, specifically, a
yeet2
world instance). You create one on line 2 and name it
w2
. That is what you
Problem with Object Interaction
By wueschn, with 4 replies.
Last reply by wueschn, over 7 years ago:
Thanks a lot, what a silly mistake.
Wombats and Leaves Fighting for a Leaf
By frogfrog, with 1 reply.
Replied to by danpost, over 7 years ago:
Probably depends on the order you placed the wombats into the world.
Wombats and Leafs Limit Question
By SilentHunter115, with 1 reply.
Replied to by danpost, over 7 years ago:
You could add the following as the first line in the foundLeaf method, to prevent "seeing" the leaf when count is 2: <Code Omitted>
Question
By tuffguy5, with 1 reply.
Replied to by danpost, over 7 years ago:
You would probably need to use the
getNeighbours
method, determine if the list returned was empty or not and, if not, (randomly?) remove (eat) one that is in the list.
Wombats facing each other
By lucky555, with 1 reply.
Replied to by danpost, over 7 years ago:
You could vertically mirror the image of the one on the right: <Code Omitted>However, this will probably redden the image and the mirroring would need done every time the wombat faces the opposite direction. Better would be to have two
GreenfootImage
fields in the class to hold a right-facing and a left-facing wombat. On any turn to 0 or 180 degrees, set the appropriate image.
Moving The Wombat
By Baseball19, with 1 reply.
Replied to by danpost, over 7 years ago:
Make line 40: <Code Omitted>
Change background in leaves and wombats
By Ravens52, with 1 reply.
Replied to by danpost, over 7 years ago:
Remove line 18.
Disappearing Wombats
By Bicpen6, with 1 reply.
Replied to by danpost, over 7 years ago:
Bicpen6 wrote...
In the Wombat and Leaves game, why do some of the wombats disappear after going around in a circle?
They are probably on top of each other (one hidden behind another).
215
216
217
218
219
220
221
X