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
Scrolling world problem
By Genota, with 4 replies.
Last reply by Genota, about 5 years ago:
Okay, now it works. Thank you!
Count act rounds
By Philinö, with 1 reply.
Replied to by danpost, about 5 years ago:
Add an
int
field to maintain count of act steps. Increment it in
act
method. Do not add an
Endscreen
object into the world if one is already in the world. You could also limit incrementing of the act step count to the same condition. Maybe having the following line as first in
act
: <Code Omitted>would suffice for both.
Ennemy checking if player is close?
By AnJoMorto, with 8 replies.
Last reply by AnJoMorto, about 5 years ago:
Thank you for both of you! It was really what I needed plus I got to understand it a little more! Many thanks!
Animation per act()
By Philinö, with 2 replies.
Last reply by Philinö, about 5 years ago:
RcCookie wrote...
You need to save which image is currently being shown. Since it’s only 2 images you can simply use a boolean for that: <Code Omitted>Then in your act method, you need to change the current image to the opposite one: <Code Omitted>This however will load an image from a file every frame, which, like you might imagine, is not very efficient. The better way to do this
Sound does not work when recording
By JustAnArchosaur, with 1 reply.
Replied to by RcCookie, about 5 years ago:
Gonna be hard to evaluate if there’s no source code…
Gif Animation
By Genota, with 3 replies.
Last reply by danpost, about 5 years ago:
Genota wrote...
Is there any other way/action to implement the feature?
It would take some doing to implement it with just the
GifImage
class. An option is to add my
Animation
class which allows for a single run through the images. You can find it
here
. Use the
GifImage
class to decode the images; then get the images to create an
Animation
object at the time animation is to begin. Use:
Probability
By Philinö, with 2 replies.
Last reply by Philinö, about 5 years ago:
@danpost that was the error, now it's working. thank you!!
Sound not working
By AnJoMorto, with no replies.
I have an interactive title screen and was trying that when the player clicks on the character he says a random sentence, one of them being a rare EasterEgg. I got this code after initiating all the sounds with GreenfootSound a = new GreenfootSound("name.wav"); <Code Omitted> After doing this, only the "ee" sound comes out 1/31 times and the rest of the time only silence comes out. Does anyone know why?
Background Sound
By ronald, with 28 replies.
Last reply by ronald, about 5 years ago:
thank you again danpost I will think about all this
problem in move and down and left and right
By Guru1998, with 7 replies.
Last reply by Guru1998, about 5 years ago:
thank u for the help..that would help me
Random spawn actors with a button
By raul124, with 5 replies.
Last reply by raul124, about 5 years ago:
Not the entire code, it wasn t exacty what i needed, but I used some part of it. This part was very helful: <Code Omitted>And this one: <Code Omitted>Overall, i were very helpful. Thank you again.
Greenfoot
By Sauravbasyalking12, with 1 reply.
Replied to by danpost, about 5 years ago:
Sauravbasyalking12 wrote...
explain the preferred access modifier used for both variables and methods
It varies on usage. For example,
get
ter and
set
ter methods are generally
public
and the fields they deal with are
private
.
Green foot
By Sauravbasyalking12, with 1 reply.
Replied to by danpost, about 5 years ago:
Sauravbasyalking12 wrote...
why using setLocation is more practical than using the move() and turn() methods
The argument can go both ways. Depends on how the actor is to move.
instantiate objects help
By NewbJava, with 2 replies.
Last reply by danpost, about 5 years ago:
NewbJava wrote...
how do I instantiate 10 different students. There is an error were it says "Cannot find symbol Variable" for both Johnson and Fred
Literal strings need to be between double quote marks.
How to make the actor fall
By lisi, with 2 replies.
Last reply by lisi, about 5 years ago:
Thanks! It works!
88
89
90
91
92
93
94
X