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
Help with Fonts
By Chipley, with 1 reply.
Replied to by nccb, almost 8 years ago:
In more recent versions of Greenfoot, we no longer use java.awt.Font and instead have our own greenfoot.Font class. Remove the line near the top that says "import java.awt.Font". Then change line 22 in the snippet to be new Font("Comic Sans MS", 32) without the Font.PLAIN part. That should get the code working.
downloading Greenfoot
By meriem, with 1 reply.
Replied to by davmac, almost 8 years ago:
Hi! The first rule of asking for help is "give details" :) Without knowing what you've tried and what happened when you did, no-one can help. The best I can say is that you can download Greenfoot from the "download" section of this website, and the installation instructions are linked from there as well.
Basic Button
By Gaming_100, with 5 replies.
Last reply by danpost, almost 8 years ago:
Gaming_100 wrote...
So what should my code look like?
Just move (cut and paste) lines 10 through 13 into an
act
method within the class.
Help with moving object
By Alexlife2002003, with 6 replies.
Last reply by danpost, almost 8 years ago:
Alexlife2002003 wrote...
any suggestions on how to make it go back down when it reaches the top?
HINT: You want to reverse directions when the actor is near the bottom (which you have) OR near the top (which you don't have).
adding a list of objects
By redenton, with 3 replies.
Last reply by redenton, almost 8 years ago:
nvm. I found a solution. but it was thanks to your advice, so thank you danpost!
input output question
By ericnjaramba, with 3 replies.
Last reply by danpost, almost 8 years ago:
ericnjaramba wrote...
the part im having trouble with is "Ask the user to input the number of singles, doubles, triples, and home runs (each asked individually)" ?
You should check out the
ask
method of the Greenfoot class.
Actors not "saved in world"
By KSH-Kinderkanti, with 1 reply.
Replied to by delmar, almost 8 years ago:
Haven't seen the problem. Sounds like the world class was not recompiled properly. Try creating a new world object manually (right-click the world subclass and select "new MyWorld()", or whatever your world is called).
Start game countdown
By Chipley, with 5 replies.
Last reply by danpost, almost 8 years ago:
Chipley wrote...
How would i be able to change the text on your pause World?
You will find the text in the middle of the
Panel
class.
Help with my pong ball
By gustavo.kill, with 4 replies.
Last reply by gustavo.kill, almost 8 years ago:
Ty my bro.
Making world generation spawn user-controlled actors, or making an actor that creates more of the same actor under user control.
By 112ccs25, with 1 reply.
Replied to by danpost, almost 8 years ago:
I really do not think you want to clone a rocket. There are no states that a rocket-created rocket would need from the rocket that created it (
gunReloadTime
is a constant all new rockets will get;
reloadDelayCount
is specific to each rocket;
acceleration
is variable and specific to each rocket; and as for
shotsFired
, I doubt you want what current value the rocket creating it has for the new rocket). Just create a new Rocket object using 'new Rocket()' instead of trying to clone one. The only thing you may have to do is match the rotation:
Need help with Marble Project
By sonali98, with 1 reply.
Replied to by danpost, almost 8 years ago:
Note that the method is declared to return a Marble object.
Need help with piano project
By Toodumbtocode, with 2 replies.
Last reply by Super_Hippo, almost 8 years ago:
If that is the whole code in your world class, then the first thing which is missing is the super call to create the world. Problem with the line in particular: The addObject method requires three parameters - an object and two ints. You have four parameters and the first one doesn't make any sense. Depending on how your Key class looks, the line could look like this: <Code Omitted>
Add an object once score reaches certain point?
By ananyagarg, with 3 replies.
Last reply by danpost, almost 8 years ago:
@Jeph, I am quite sure there is a problem with this line: <Code Omitted>Also, not only will your loop add a rock at all location at one time, but the
if
condition will most probably be true for many act cycles in a row -- meaning rocks will be added in an abundance. Again, I urge that the adding of rocks dependent on the score be done in the
MyWorld
class act method. The "dying" of the world should be implemented there also. Without knowledge of the number of rocks initially in the world and if any are ever removed, it would be difficult to
Get random number problem
By Chipley, with 2 replies.
Last reply by danpost, almost 8 years ago:
Move line 12 to be line 35. At line 12, it is assigned a value only once (when the world is created). At line 35, it (as a new variable each time) will be assigned a (new) value each time you are creating a new BottomPipe object. Also, to get a number between 20 and 200, inclusive, use: <Code Omitted>
how to make actor keep walking on a square?
By jc5879, with 3 replies.
Last reply by danpost, almost 8 years ago:
jc5879 wrote...
<< Code Omitted >> like this way?
You got the 4th direction in; but, you still need to reset
steps
to zero when turning. There is also now a problem that
getRotation
returns a value between
0
, inclusive, and
360
, exclusive. It will never be
-90
, as your new condition compares it to.
236
237
238
239
240
241
242
X