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
Impassible objects...
By Sparky, with 11 replies.
Last reply by AngelusNeko13, about 11 years ago:
guys can u help me with making two cars collide and end the game when you crash into the other cars? this is my code i used: <Code Omitted>
How do I get my sound to play when i want it to play and stop when i want it to stop?
By Myopunk119, with 2 replies.
Last reply by danpost, about 11 years ago:
The sounds initialized in the 'sounds()' method are assigned to local variables and are NOT set to the fields declared in lines 18 through 21. Do not declare new variables in the method, just assign the fields you already have. That is, for example: <Code Omitted>
How can I make pressing a key create an actor?
By Zinkley, with 1 reply.
Replied to by davmac, about 11 years ago:
You've got three problems here - try to ask one thing at a time. It's easier to help you then. I'd start with this:
Second: When i write the code in the crab actor it is unable to place a new actor; it brings up an error message.
You have an error message, so you need to post it. You have code, so you need to post that too. And as a general hint: the time I've taken to write this means I've got less time to help you (and others) actually solve the problem(s). Try to be more specific and give more information. Always post your code; always post the exact text of any e
how to make music change by command
By AngelusNeko13, with no replies.
hey guys do any of you know how to make music change by using the keys?, as in like using a car radio and making the songs change by the keys as a command but stopping the last song you were listening to and starting the one you choose
How to let my actor walk on platforms
By madflac, with 6 replies.
Last reply by RadiantCheddar, about 11 years ago:
Oh i was looking at the web page not the scenario sorry
jar file without "Run" or "Reset"
By Psychpsyo, with 1 reply.
Replied to by davmac, about 11 years ago:
You can put "Greenfoot.start()" in your world's constructor so that the user doesn't have to click "Run" to start your game. There's no simple way to remove the Run and Reset buttons altogether, although that might be available in the next version of Greenfoot.
How do I test if left mouse key is down
By RadiantCheddar, with 1 reply.
Replied to by danpost, about 11 years ago:
Get a MouseInfo object and call 'getButton' on it. See the
Greenfoot class API documentation
followed by the
MouseInfo class API documentation
.
Hey
By alba1888, with 1 reply.
Replied to by danpost, about 11 years ago:
Just try and throw something together. If you run into specific problems, then start a discussion thread on that, specifically. No one is going to do your homework for you -- you cannot learn anything that way.
Act Method
By chanmw196, with 1 reply.
Replied to by danpost, about 11 years ago:
The act method is called by the greenfoot framework on all active objects while the scenario is running. This includes the act method of the active world and the act method of every actor object within that world. It is the initial "loop" that animates your world. The code you place within these act method are what you want these objects to do during any cycles of act methods. One complete set of act method calls (for the active world and all actors in that world) is called an act cycle (aka frame). Greenfoot controls the delay between act cycles to regulate the speed of the scenario whic
Stop background music
By ekavanag, with 1 reply.
Replied to by Super_Hippo, about 11 years ago:
You have to keep a reference to the GreenfootSound object when creating it and call the 'stop' method on that object.
Shooting Bullet causes error
By ekavanag, with 3 replies.
Last reply by ekavanag, about 11 years ago:
nevermind I sorted it out
how do I wait
By RadiantCheddar, with 5 replies.
Last reply by danpost, about 11 years ago:
RadiantCheddar wrote...
I have another actor called bee which is chasing the ball. How would I get the x of the ball from within the bee class. Also each ball is only supposed to be able to boost once as of right now.
In the Bee class, you can use: <Code Omitted>,
Piano Scenario
By Mack, with 1 reply.
Replied to by danpost, about 11 years ago:
It would be similar to how the key field is declared, how its value is accepted and saved in the field by the constructor.
Boss
By Zinks2, with 13 replies.
Last reply by Zinks2, about 11 years ago:
Ok; i will try it! Thx!
I made this program, where a plane drops bombs every couple of seconds, but when it makes a bomb it stops moving here is my code:
By sheshank, with 1 reply.
Replied to by danpost, about 11 years ago:
You say "it stops moving", however, you have a plane, a bomb and the scenario as a whole. Which stops moving? If you are getting an error message, you should be posting the terminal printout. The problem does not appear to be in the class given -- maybe it is located in your Bomb class.
533
534
535
536
537
538
539
X