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
can anybody tell me what is wrong with this coding
By Kayberry, with 1 reply.
Replied to by danpost, over 5 years ago:
Your
angle
, at line 15, is in radians; but you use it on line 16 like it is in degrees.
Need help creating a grid of squares
By cxcpio, with 6 replies.
Last reply by cxcpio, over 5 years ago:
Alright I finally managed to make it work thank you so much!
How to access Variables from touching subclass?
By ElwoodHogan, with 7 replies.
Last reply by danpost, over 5 years ago:
ElwoodHogan wrote...
That fixed it! It now works perfectly. Thank you for your help danpost. Appreciate it.
The reason why the "
double
" word needed to be removed is that with it, you are defining a NEW local variable with the same name as the pre-defined field; without it, it will refer to that pre-defined field. Line 5 can also be written as: <Code Omitted>
how to do gravity?
By WINER8, with 5 replies.
Last reply by danpost, over 5 years ago:
WINER8 wrote...
RcCookie when i was writing the code "setLocation(getExactX(), getExactY() + vY);" the greenfoot inform me there are not method getExactX() and method getExactY() can you help me please
RcCookie wrote...
Say you have a class Player.
This class should extend SmoothMover
, a Greenfoot class that uses floating-point variables to store the actors position. You can import it by right-clicking onto the panel with „Actor“ in Greenfoot and selecting „Import“.
Although, I am not sure about the instructions given to import it. I know of using the menu bar with :
Help me to fix SOUND!!
By astawakadek, with 2 replies.
Last reply by astawakadek, over 5 years ago:
Thank you, I didn't think about it, and it's going well!
Making actors stay on top of each other (overlay)
By Paul12345, with 4 replies.
Last reply by Paul12345, over 5 years ago:
danpost wrote...
Adding looks okay. Do you have an
act
method in your
NodeRB
class (if not, a class it extends)? Show, if so.
I realized my mistake. Since i was updating the locations of all objects in my WorldScrolling method I didn't have to update my text location in my NodeRB also, since it was already added in the world over it. Thank you for your feedback though !
jukebox or album music
By ronald, with 11 replies.
Last reply by ronald, over 5 years ago:
i will see what i can do and keep you posted thank you
How to edit new subclass template
By Quabey, with no replies.
Hello, today I was wondering how to change the template when you create a new subclass. I found the post from Super_Hippo (https://www.greenfoot.org/topics/58272/0), but it seems outdated. So here's an update on how it works, because I think I'm not the only one who annoyed by the explanation you have to delete every time you create a new subclass. If you want to edit you need to go to
C:\Program Files\Greenfoot\lib\english\greenfoot\templates
there you will find the
actorJava
file in which you can edit the template for new subclasses. In the same folder is also the worldJava file which can be edited to change the MyWorld template. I personally removed the Act explanation and the import greenfoot.*; comment. It now looks much cleaner. I hope I could help someone.
static and final ???
By ronald, with 8 replies.
Last reply by ronald, over 5 years ago:
even if I am yet to understand, I think that with time and practice, it will eventually assimilate
Need help with Mars Rover.
By MaxMiller96, with 4 replies.
Last reply by danpost, over 5 years ago:
MaxMiller96 wrote...
Unfortunately, your suggestion didn't bring anything. He still turns left instead of right on the left side. Still, many thanks to you.
You need to move line 3 up outside the
act
method (line 0 or -1). You have it where it is always a new var assigned with "
links
". It ?may? also be required that it should be assigned "
rechts
", instead.
How to memorize the last key pressed?
By AnJoMorto, with 2 replies.
Last reply by AnJoMorto, over 5 years ago:
danpost wrote...
Best would be to keep gifs in fields and have a specific field for the active gif. Something along these lines: << Code Omitted >>
You made some mistakes it seems, but I corrected it and it works perfectly! Thank you so much @danpost . You've been the person behind my whole project since you answer all possible questions I find in this platform. Thank you again. And here's the corrected code for those who need it:
Images not displayed
By marv47, with 2 replies.
Last reply by danpost, over 5 years ago:
marv47 wrote...
When I rightclick on my class to set an image (from the greenfoot preset images) e.g. as the background the image is not displayed I tried this with other classes and images aswell but none of them are displayed. <Image Omitted>
The actors' images should change when you "
Reset
" the scenario.
My Characters wont jump for some reason
By MrSkyPanda, with 1 reply.
Replied to by RcCookie, over 5 years ago:
You aren’t calling the jump() method, only the checkJump() method. You generally don’t need the gravity variable. If you want to be able to adjust the gravity strength you need to adjust how much vSpeed is changed when the object is falling
Mouse click hold ?
By Paul12345, with 1 reply.
Replied to by RcCookie, over 5 years ago:
You need to track the mouse‘s state: <Code Omitted>If you want pressed only to be true if the mouse was clicked onto a specific actor, replace the null in line 4 with the specific actor, BUT NOT in line 5! <Code Omitted>
Explanation in need
By Roshan123, with 10 replies.
Last reply by RcCookie, over 5 years ago:
No, that are just example methods that show what should be done in a certain case. These methods are: getSpeedX() getSpeedY() setSpeed() paintToColor() setColors() They just indicate what could be implemented right there
107
108
109
110
111
112
113
X