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
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!
Different behavior in gif appearance depending on distance
By BogdanMicu, with 6 replies.
Last reply by BogdanMicu, about 5 years ago:
Thanks!
Problems with GamePadTemplate in v.3.6.0
By AnJoMorto, with no replies.
I've tried to use the GamePadTemplate proposed in the documentation with Greenfoot 3.6.0, but it seems to be outdated. I always gives me this error message: java.lang.ClassCastException: class jdk.internal.loader.ClassLoaders$PlatformClassLoader cannot be cast to class java.net.URLClassLoader (jdk.internal.loader.ClassLoaders$PlatformClassLoader and java.net.URLClassLoader are in module java.base of loader 'bootstrap') at GamePad.<clinit>(GamePad.java:98) The line where at GamePad.java:98 is : final URLClassLoader cl = (URLClassLoader) parentCL; Has anyone else encounter this problem and find a solution or is there a new way to connect a game controller to a Greenfoot program? Or am I just loosing my time maybe... Any help will be appreciated
adding an object from the code
By gorilA876, with 1 reply.
Replied to by RcCookie, about 5 years ago:
What you do add the object itself to the world it is already in, so you do nothing. You first need to create a new instance of Missile and then add that instance to the world: <Code Omitted>Or shorter: <Code Omitted>
88
89
90
91
92
93
94
X