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
Music
By Heet_Patel, with 2 replies.
Last reply by Heet_Patel, over 8 years ago:
tnx i forgot
getRandomNumber
By intanmuliawati, with 2 replies.
Last reply by intanmuliawati, over 8 years ago:
thankyou so much danpost
Variable issue, in desperate need of help :l
By Javalicious, with 2 replies.
Last reply by danpost, over 8 years ago:
Javalicious wrote...
i'm trying to make a little dude that walks around with a 2 picture walking animation, but i cant seem to get it to do the second frame
You are creating new images every act cycle. So, first thing you should do is move, at minimum, lines 22 through 35 to outside the
act
method. Next thing I noticed was that you have 6 different variable for movement, which is way overboard; but, I won't get into that right now (as you just want a quick fix). Line 42 should probably be moved outside the
act
method, so if no keys are currently pressed, the last moveme
java and pseudocode Declaration
By Ticker175, with 4 replies.
Last reply by Ticker175, over 8 years ago:
That's exactly what i was looking for thanks for the help =)
Help with changing variables of the actor that has been shot at
By SPCWW, with 2 replies.
Last reply by SPCWW, over 8 years ago:
It worked! Thanks.
Actor moves random (german)
By Vizemesiter, with no replies.
Ich brauche unbedingt Hilfe bei meinen Hausaufgaben. Und zwar habe ich den Actor IronMan, dieser wird von einer Kugel eliminiert. Diese Kugeln (mehrere) sollen sich zufällig in meiner Welt bewegen, nur weiß ich nicht, wie man das macht. Ich bitte um Hilfe!
Password
By CarmanRose, with 3 replies.
Last reply by danpost, over 8 years ago:
CarmanRose wrote...
if(input == "password")
Here is the problem. You are taking two
String
objects and asking if they are the same object. That is, you are not asking about what the two distinct
String
objects contain as far as their characters. You compare the contents of two strings using the
equals
method: <Code Omitted>It is always best to put the literal (or known entity) first (so you are not calling a method on a
null
object).
Level complete
By XswimmerX1504, with 2 replies.
Last reply by XswimmerX1504, over 8 years ago:
Thank you.
Is it possible to read and write to a file?
By Xolkiyr, with 4 replies.
Last reply by Xolkiyr, over 8 years ago:
danpost wrote...
Xolkiyr wrote...
What about a mysql database?
I suggest you experiment to find out. It is the best way to learn what is possible and what is not.
touché
How do I reference an actor's integer to the world
By Lavenger, with 18 replies.
Last reply by danpost, over 8 years ago:
Yehuda wrote...
...as you were instructed, and yes, the "addedToWorld" method is overriding an already existing method with that name just like the "act" method does.
... and is called by the greenfoot framework on actors when added into a world.
Angles in Rotation Limit
By Applez, with 4 replies.
Last reply by danpost, over 8 years ago:
Applez wrote...
Thanks, and how do I make cars randomly spawn?
Well, you probably do no want cars to spawn on each other, so using a random timer would probably be best. Something like this: <Code Omitted>In line 8, the added value, 30, is the minimum delay time and the random part, 150 is the variable delay range beyond the initial 30.
How do I make my score go up by one?
By applecider124, with 2 replies.
Last reply by applecider124, over 8 years ago:
danpost wrote...
How about this for line 72: <Code Omitted>Only thing is, if you stop the program (line 71), the Counter object image will not update.
Thank you!
Making a scoreboard
By Green_for_Fun, with 7 replies.
Last reply by danpost, over 8 years ago:
Green_for_Fun wrote...
I did not just throw the scoreboard class together, I just honestly don't know where to go.
Well, if I was mistaken -- I apologize. However, intentions still unknown. Also, what specifically do you want to tackle about it first?
I'm Trying to Make a game
By razornale, with 7 replies.
Last reply by danpost, over 8 years ago:
Line 62 is just a spelling error (see line 61). For line 63, I presume
space
is another class on which you are trying to execute the
gameOver
method; but you need an object of the class to run the method (not the class itself).
Out of Memory error when adding sound to character
By Bevmo831, with 1 reply.
Replied to by davmac, over 8 years ago:
You're creating a new GreenfootSound every act cycle. Create the sound in the constructor, assign it to an instance variable, and call play() (not playLoop()) on it from the act() method. I
think
that should work fine.
258
259
260
261
262
263
264
X