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
incompatible types: java.lang.Class<dino> cannot be converted to greenfoot.Actor
By Levantaj, with 4 replies.
Last reply by Levantaj, over 6 years ago:
It's working properly now.
Can't stop updating text
By Levantaj, with 3 replies.
Last reply by Levantaj, over 6 years ago:
Thanks!
I need desperate help with making levels
By Happycrusher764, with 9 replies.
Last reply by danpost, over 6 years ago:
Happycrusher764 wrote...
How do i get reference to the counter object
Same as in Strawberry class above, except instead of
getWorld()
you would use
level2
.
how do i adjust the value of the counter value? sorry im brand new to coding
<Code Omitted>taking value of score in current counter and making score in counter of
level2
equal it.
Greenfoot on Linux Mint
By eljot, with no replies.
Hello, I've installed Greenfoot 3.6.1 on an new Linux Mint; no problems. When I try to do something with Greeenfoot (a new Stride-project) after about 5 seconds, the whole system slows down extremly (max. speed of mousepointer on the screen : 10 cm in 10 seconds). I do not live inside the processor, but it feels like a bunch of infinite loops generated by Greenfoot. Under MS Windows 10 on the same PC it'a all OK. Thanks in advance for any hint Jochen
What is a constructor
By dejong1968, with 1 reply.
Replied to by danpost, over 6 years ago:
dejong1968 wrote...
fom 09 - 13 sec the author says that "a constructor is a special method that runs when you first create an object". So I conclude a constructor is a method... (special method). Then, at 22-23 sec he says that the Circle() - part is the constructor
He was definitely not clear as to what he was trying to say. This line: <Code Omitted>does not contain a constructor. "Circle()" is the name of a constructor and "new Circle()" calls that constructor to execute, creating a new Circle object. A constructor looks exactly like a method, except fo
Removing the ability to spam keys
By DaRafster, with 1 reply.
Replied to by danpost, over 6 years ago:
DaRafster wrote...
Hi, I managed to map out a sound file and an image file to the space key, however if you spam the space key, the sound file can't seem catch up to the flashing image. So how would I add a delay of some sort that would only allow the player to press the space key every 2 seconds?
Add an int delay (timer) field. Set it to 120 when space is pressed. Reduce its value by one if it is not zero. Put condition on checking space key that its value must be zero.
Dont respond to this
By Happycrusher764, with 2 replies.
Last reply by Happycrusher764, over 6 years ago:
<Code Omitted>
Displaying an Image when a key is pressed
By DaRafster, with 4 replies.
Last reply by DaRafster, over 6 years ago:
thank you guys for your help, will keep this future knowledge in mind
Keep getting error :/
By footpickle, with 9 replies.
Last reply by footpickle, over 6 years ago:
Turns out I'm an idiot. I changed the "Actor actor = (actor)" to "Plane2 plane2 = (plane2)" without realizing that wasn't how it worked. Thanks for your help anyway!
If Statement Help
By DaRafster, with 5 replies.
Last reply by danpost, over 6 years ago:
DaRafster wrote...
Going into the code itself and changing the values. Sorry if I'm not being clear enough
Then, what do you need an
if
statement for? Just build the world based on their values. The width of the world divided by the width of a white key should give the number of white keys to add. You can add the black keys up to, but not more right than the last white key. Using for loops to add the keys into the world would be the way to go.
why doesn't this work...
By Cool, with 3 replies.
Last reply by danpost, over 6 years ago:
Try using the
Actor
instance method
getWorld
on
World
instance methods like
getObjects
and
removeObjects
. Like: <Code Omitted>
how to convert greenfoot project to exe file?
By Rafiqi_Fariz, with 13 replies.
Last reply by Rafiqi_Fariz, over 6 years ago:
Thanks for your advice
Ping Pong Game
By _kr_696, with 19 replies.
Last reply by danpost, over 6 years ago:
_kr_696 wrote...
ok so if i want to update the score i would have to call the ball class in the world class, right?
No. You would call a method in your
MyWorld
class from the
Ball
class when scoring. Calling the method to update the scoreboard can be done from either class.
Change profile name.
By suzbo, with 1 reply.
Replied to by Super_Hippo, over 6 years ago:
Unfortunately, you can’t.
Is there a way to convert String input to Integer
By egc2505, with 1 reply.
Replied to by Super_Hippo, over 6 years ago:
You can use the “Integer.valueOf()” method. It takes a String as a parameter and converts it to an int (or gives you an error when the string isn’t a number).
145
146
147
148
149
150
151
X