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
How do I get an object to disappear off-screen?
By Blake1996, with 5 replies.
Last reply by danpost, over 11 years ago:
@Blake1996, Zamoht used the method at line 5 of the 'act' method given. His 'isOffScreen' method is similar to the 'atWorldEdge' method supplied in the 'Animal' class (if you are familiar with that). If the incoming objects that need to be avoided travel only one way across the screen then only the particular edge you want to remove the objects at need to be checked. So, basically, if they are added at the right edge and move across to the left, you could use: <Code Omitted>You would put this line in the 'act' method of the class that creates
How Can I make a object shake?
By Kaiwalya, with 10 replies.
Last reply by danpost, over 11 years ago:
No. You could use an int field to track windspeed and have it vary randomly. Then, when the difference between the speeds of the plane and wind are greater than a certain amount, create the shake; and if the difference is less than a certain amount, create loss of lift (if you want). If doing the lift thing, you will need an instance int field for it, too.
Physics Engine - Confusion With getY/X() via Multiple Objects
By 8bitcarrotjuice, with 25 replies.
Last reply by 8bitcarrotjuice, over 11 years ago:
Thank you so much!
Infinite Parameters
By Kartoffelbrot, with 5 replies.
Last reply by Kartoffelbrot, over 11 years ago:
Thanks
Trouble With Finding Closest Player
By K_wow, with 5 replies.
Last reply by K_wow, over 11 years ago:
Never mind, found the problem, a simple typo.
How do I display my Start Screen?
By redninja21, with 1 reply.
Replied to by danpost, over 11 years ago:
Just manually create a new 'start screen' world to make it be the first to show.
Respawning???????
By Kaiwalya, with 19 replies.
Last reply by danpost, over 11 years ago:
I was just saying that with the Text class as I have given it, you can use it for, let us say: (1) a wave text object (2) a score object (3) a message object (4) a highscore object all at the same time. My 'Pong Pinball' scenario has a Text class that is used twice in the Arena world class and twice more in the Paddle class to create four different Text objects. Download it and review the code to see how it works.
drawImage with ImageIcon
By Kartoffelbrot, with 5 replies.
Last reply by Kartoffelbrot, over 11 years ago:
Thanky, but because I painted an own image, which is only black they don't look like buttons any more. I didn't know that JLabels can be used as buttons, too, but I don't want to change it all, because all 64 fields (I have made a class "Feld" for them) are JButtons and in the GUI class they aren't saved in an array or a list like I wanted that first. I've enumerated them like: JButton jButton1 = new JButton(); JButton jButton2 = new JButton(); JButton jButton3 = new JButton(); That's very ugly, but I don't have much experience with that. My try to use an Array and to save them with a
Even numbers
By Kartoffelbrot, with 4 replies.
Last reply by Kartoffelbrot, over 11 years ago:
thanks
Don't start the game until you click on an object
By joeschmoe, with 2 replies.
Last reply by davmac, over 11 years ago:
Do you need anything else to be displayed at the same time as the button to start? If not, just have the button intiialise the rest of the actors etc when it is clicked. Otherwise, you need to have the actors check whether the scenario is running (according to your own criteria) before they do anything. For instance, you could have a variable in the world which is true if the scenario is running (your object has been clicked) or false if not.
doubt in green foot
By viyyashkumar, with 3 replies.
Last reply by danpost, over 11 years ago:
The simplest thing to do would be to remove all objects, clear the background and draw the message on the background itself.
Greenfoot for Chrome OS?
By thekidj, with 2 replies.
Last reply by erdelf, over 11 years ago:
I dont know much about it, too, but wouldn't the normal linux package work?
problems with spawned units health bars
By darkmist002, with 9 replies.
Last reply by danpost, over 11 years ago:
With the way I suggested above, the healthbar will be removed at the time the enemies object who owns it is removed.
Tutors
By Sparky, with 3 replies.
Last reply by danpost, over 11 years ago:
The Balloons and LunarLander scenarios are just sample projects that come with the Greenfoot download. Tutorials are not included with/for those scenarios.
What's wrong with it?
By Kartoffelbrot, with 3 replies.
Last reply by Kartoffelbrot, over 11 years ago:
Or I put line 5 and line 7 together to one if-statement. Thank you, I understood now whats wrong with it. It works now.
801
802
803
804
805
806
807
X