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
Random movement
By xixEmilyxix, with 1 reply.
Replied to by Gbasire, over 3 years ago:
you can try this, the object will move at the same speed (2 for example) but at a random direction : <Code Omitted>
How do I use a custom image for a class
By Gabe1098, with 2 replies.
Last reply by Roshan123, over 3 years ago:
The best image edidtig app according to me is photoshop cc U can buy it officially or if u don't want then u can get its pirated version on chrome(it may contain virus) Download it on ur own risk
Tell me what is wrong here, what I am missing.
By divinity, with 24 replies.
Last reply by divinity, over 3 years ago:
Many thanks danpost finally got it to work properly and it is thanks for all of the help. and thanks for the patience u have shown me. thanks again <Code Omitted>
Check an input is in a certain range and if not displaying an object
By xixEmilyxix, with 20 replies.
Last reply by danpost, over 3 years ago:
xixEmilyxix wrote...
Thank you, i didnt realise i missed that out
Understandable, as you quoted before I posted the edit. That is why I mentioned it was edited in my post immediate following the given code.
Background Music
By StndRed, with 2 replies.
Last reply by StndRed, over 3 years ago:
Thank you
can someone tell me what is wrong with my program
By divinity, with 3 replies.
Last reply by danpost, over 3 years ago:
You need another closing bracket after line 61 (which means one needs remove somewhere below that -- probably near the end). Similar concerns at lines 75, 89 and possibly elsewhere. Please fix indentations prior to posting here again. All paired bracket should be at the same indentation positions (that will help in keeping them paired properly)
Greenfoot.mouseClicked(this) remove object.
By StndRed, with 5 replies.
Last reply by StndRed, over 3 years ago:
Works like a charm. Thank you
Modify constructor code
By octav20071, with 2 replies.
Last reply by octav20071, over 3 years ago:
danpost wrote...
octav20071 wrote...
I want to modify Greenfoot's constructor code, for MyWorld and actors, but where is the script located? I know what I'm doing, I only want to know what is the path to the text file.
If you want to modify the templates for when the classes are created, you can use any text editor finding the files at: greenfoot/lib/english/greenfoot/templates
alright, thank you very much!!
How can I add background music while the game is running?
By Pabloseb_, with 1 reply.
Replied to by Roshan123, over 3 years ago:
<Code Omitted>
can some correct this error plz
By divinity, with 5 replies.
Last reply by danpost, over 3 years ago:
danpost wrote...
no valid values have been assigned those variables prior to the constructor calls.
Assign values to them prior to calling the constructors.
Why the iframe of my game not work?
By 23571113, with 2 replies.
Last reply by 23571113, over 3 years ago:
Thanks! It woks pretty well now.
Animation with Image Arrays overriding each other
By BaseEvoli, with 2 replies.
Last reply by danpost, over 3 years ago:
It is not easy to give advice here. On one hand, there is lag due to reading in multiple images during game time. On the other hand, there is a lot of memory used up if the images are loaded up front. However, that is what I think you should do -- load all the images into arrays when you create the character. With these field arrays, you can add one more field array for the one that is currently being used (by setting it equal to one of the others). Use only one timer for the current animation (along with the shot delay timer). You will also not need fields for frame counts (size of arra
Pop-up message
By StndRed, with 7 replies.
Last reply by Super_Hippo, over 3 years ago:
You can use the Color class provided by Greenfoot. It is very similar to java.awt.Color. You have to create an image, set the color and then use the drawString method to draw text with the given text color to the background. However, if the text on the image is everything you need, it might be enough to use another constructor for the GreenfootImage class. You can set the text color (‘forgreound’) directly. Check the API here:
https://www.greenfoot.org/files/javadoc/greenfoot/GreenfootImage.html
identifier expected
By divinity, with 3 replies.
Last reply by danpost, over 3 years ago:
Use "<AbstractButton>" in line 1 (instead of what you put).
Java Exception for my code in Greenfoot
By Freddy05, with 9 replies.
Last reply by RcCookie, over 3 years ago:
I don’t know - java has ways to invoke JavaScript commands. But as far as I know that also doesn’t work online. But if someone can get that to work that would open a whole new set of options.
56
57
58
59
60
61
62
X