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 show me how to remove an enemy after being shot?
By Tryxe, with 8 replies.
Last reply by Tryxe, about 9 years ago:
It's working perfectly thanks!!!
Locking controls and Asking questions.
By MJBelmer, with 4 replies.
Last reply by MJBelmer, about 9 years ago:
Wonderful! Just this little bit of code explains so much to me, I really love learning this... Thank you!
How to search for objects and remove them.
By MJBelmer, with 11 replies.
Last reply by danpost, about 9 years ago:
The one at line 23 should not do anything (it should always return false). You can remove that line. The one at line 9, on the other hand, is placed okay; however, it would be better placed between lines 8 and 9 in the act method code above.
Is there a way to count objects of a specific Class, or even multiple classes?
By DukeFutzwillus, with 2 replies.
Last reply by DukeFutzwillus, about 9 years ago:
Thank you very much I wanted to use the .size but didn't know it.
Altering variables for specific objects of one class from another.
By MJBelmer, with 2 replies.
Last reply by MJBelmer, about 9 years ago:
Ahh Thank you! I'm still learning these concepts and how exactly to implement them. It worked perfectly thank you! Now to work on how to reset the Dragon positions and remove remaining fireballs after the score is updated. Eep!
How do I get Alien to re spawn at the top of the screen?
By dlamc, with 3 replies.
Last reply by danpost, about 9 years ago:
dlamc wrote...
Something I should have mentioned before hand, is that when an alien touches the bottom of the screen two more have to spawn at the top of the screen then move down. How would I do something like that ?
I said you could just switch the two lines. That would be so you can add the new Alien object into the world before loosing the reference to the world, which happens when you remove the current Alien object from the world. Just add two new Alien objects into the world before removing 'this'.
Change background on collision
By DukeFutzwillus, with 6 replies.
Last reply by danpost, about 9 years ago:
Apparently you have 'static' fields in other classes that will need to be initialized in the MyWorld class as well (to mention one, PortaltoPlanet.nextLevel).
Alternatives to greenfoot
By fejfo, with no replies.
I liked greenfoot mainly for
graphical support
collision detection
input handling
But more I have been doing more advanced things for which greenfoot isn't as good. So are there any good alternatives? I definitely want:
graphical support
collision detection (preferably even polygon collides)
a better IDEA
And I would like:
networking support
3D and full screen support
input handling
I'm probably willing to learn a new language. But I don't want something that has a big complex interface (like Unity). I still want control over basic things (like movement). any suggestions?
How to apply gravity the simpliest way?
By Astralman, with 19 replies.
Last reply by Astralman, about 9 years ago:
Thanks, it works. <Code Omitted>
Newtons Lab 2 Second Edition Cannot find symbol - class Color
By koloughlin, with 1 reply.
Replied to by danpost, about 9 years ago:
The error is probably not in the Body class, but rather in your World subclass where you try to create a Body object. You can add an import line for the Color class or change 'new Color(12, 12, 12)' to 'new java.awt.Color(12, 12, 12)'.
Complition of a chess board using a horse!
By CatalinM, with 1 reply.
Replied to by danpost, about 9 years ago:
I would start by having two world constructors. The first one with no parameters would call the second one with an int parameter to indicate the number of squares along one side of the board. This second constructor should possibly create and set the background image and add the horse into the world. The act method could check for numeric keystrokes between 5 and 9 (perhaps) to recreate the world with a different size.
Trying to animate my character
By GTRLambo26, with 1 reply.
Replied to by Super_Hippo, about 9 years ago:
Remove all the 'else ...' from the animateDown method. You only need to make sure that if no down1...11 image is used (so coming from a different direction), you set one.
java long nullpointerexception
By divinity, with 27 replies.
Last reply by divinity, about 9 years ago:
thanks very much danpost, it work out well, many many thanks danpost and super_hippo
How to create an Otherclasses?
By LiuHan, with 3 replies.
Last reply by LiuHan, about 9 years ago:
Found it, thank you guys!
How to stop music in actor when greenfoot stops and when world changes
By Henkbot, with 2 replies.
Last reply by danpost, about 9 years ago:
You might make use of my BgMusic class which is located in my
BgMusic Actor Class Demo
scenario. The class is designed to control the background music regardless of the active world. The use of the 'stopped' method is still required when the scenario changes from the running to the paused state (and the 'started' method when going the other way); but, no reference is needed to the BgMusic object because of the way the class was designed. All your World subclasses will need implementations of both the 'started' and 'stopped' methods if all
421
422
423
424
425
426
427
X