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
Incomparable Image and String Error
By Nameless477, with 9 replies.
Last reply by Nameless477, over 9 years ago:
aha! placing the code in the act method of the Card class achieves the desired results. Thank you :)
Why is there a null pointer exception
By GreenfootNewbie2000, with 13 replies.
Last reply by Yehuda, over 9 years ago:
danpost wrote...
Oh, please stop!
Done.
Keeping counter value over worlds.
By OKNEM, with 12 replies.
Last reply by OKNEM, over 9 years ago:
So I've found that this works, but the worlds are on a loop. I've tried to take what you said and input this into the act method of Myworld3:
Leaves and Wombats
By anu1217, with 8 replies.
Last reply by anu1217, over 9 years ago:
Yes, I found out how to change the way the wombats move. That was what I was looking for.
How can i spawn an actor from another actor
By Lucius, with 3 replies.
Last reply by Yehuda, over 9 years ago:
FutureCoder wrote...
it's not working because you can't just use normalbullet.setRotation(getRotation()); to get the rotation.
That's not really true, if the setRotation method is public in Actor then it can be called on any instance of Actor. If NormalBullet is an extension of Actor then technically the following will work on it also: <Code Omitted>There are methods which you can't call like this since they are 'protected' methods in class greenfoot.Actor as opposed to 'public'.
Missing Colors in Greenfoot.Color
By Caotianyu, with 2 replies.
Last reply by Yehuda, over 9 years ago:
It think Java originally had lowercase letters then added in the capital letters since the colors are constants. Greenfoot only used the constant named fields, which are the same colors as the lowercase ones.
Player's actor unable to add objects?
By alittle_bit, with 2 replies.
Last reply by alittle_bit, over 9 years ago:
Right! I always assumed that the Player's constructor ran the moment a Player object was added to the world & so you would of already had a world to run the getWorld() method in... Thanks
How to do setImage when in collision
By CaiDampier, with 4 replies.
Last reply by Yehuda, over 9 years ago:
danpost wrote...
Yehuda wrote...
but the image will change back when you press a key
Not if the code for collision checking is after the key checking code.
But no one said where that code is going to go, but it does make sense to be after the movement code (which is when/where the collision happens).
trouble need help
By B4Programming, with 3 replies.
Last reply by Yehuda, over 9 years ago:
danpost wrote...
However, the way Yehuda has shown it will not allow you to set the rotation of the Cherry object created.
I was just saying that adding an Object into the World then right afterwards changing the location is unnecessary. (But I guess I did have in mind that a new cherry should be created each time, forgetting about the rotation).
Greenfoot Glitch
By n_ibra, with 2 replies.
Last reply by Yehuda, over 9 years ago:
Since the code is in an Actor the code is being run in every Actor that's in the World, so the more Actor's that are in the World the more this code is being run, so the amount of Vehicles multiplies (exponentially).
Not able to understand wait methd
By Kalpshah6, with 5 replies.
Last reply by danpost, over 9 years ago:
Yehuda wrote...
The 'wait' method can also be used for time, not only until notify() is called but it's a method in Object meant to be called on/from an Object, it doesn't stop the whole execution of a program.
It will not "stop the whole execution of the program"; but, it will delay the whole execution for the wait duration (meaning all actions are suspended until the wait is over).
I can't remove a GreenfootImage
By JonahZW, with 2 replies.
Last reply by JonahZW, over 9 years ago:
Thank you!
color help
By batuts1, with 3 replies.
Last reply by Yehuda, over 9 years ago:
The only thing needed to be done is: <Code Omitted> If that's the error then that means that there is a greenfoot.Color class, meaning that the GreenfootImage.setColor method needs a greenfoot.Color (not a java.awt.Color). The error is coming since there are two Color classes you can be referring to, so you have to specify which one you're talking about.
Wall combine corner and rotation
By Yannickk, with 3 replies.
Last reply by Yehuda, over 9 years ago:
Yannickk wrote...
I did everything i could but it won't work. Sorry i am trying to do my best i can but i can't understand it.
What can't you understand, it's your class (I would think). The only (other) reply that's here is the one by danpost and that's saying how he doesn't understand your code.
Greenfoot doesn´t support .Wav?
By JanJet2000, with 6 replies.
Last reply by Yehuda, over 9 years ago:
JanJet2000 wrote...
Fixed it by myself Needed to add the Name in the new GreenfootSound brackets... But still thank you
Naturally you have to say which sound you want to play, Greenfoot can't play a sound if you don't say which to play.
346
347
348
349
350
351
352
X