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
Spawn new actors when there are no bullets
By raul124, with 2 replies.
Last reply by raul124, almost 5 years ago:
Your idea worked. But after some thinking I ended up makind to different buttons, one for each action I needed. Thank you very much!
Projectile Animation
By Genota, with 1 reply.
Replied to by danpost, almost 5 years ago:
Remove line 137.
Can I add objects to the world with a for() loop?
By BlueHand, with 9 replies.
Last reply by danpost, almost 5 years ago:
BlueHand wrote...
Thanks, but I notice that something is up with the last parentheses of: <Code Omitted> It says " ']' expected "
Correction: <Code Omitted>
Set image from another actor void act()
By alex_denis20011, with 3 replies.
Last reply by alex_denis20011, almost 5 years ago:
Thank you Dan,I m grateful for this,sorry that i'm vague.
Shooting in both directions?
By Genota, with 1 reply.
Replied to by danpost, almost 5 years ago:
If you would rather not compare ALL the possible images to the current image, I would suggest you add a
boolean
to track the currently facing direction. Update it when a movement key is pressed and use it to determine shooting direction.
Movement debug
By BogdanMicu, with 6 replies.
Last reply by danpost, almost 5 years ago:
Needs collision checking in (moving) Platform class. Must keep platform off actor.
Menu music
By BogdanMicu, with 14 replies.
Last reply by BogdanMicu, almost 5 years ago:
Now it works! Thanks a lot! I feel like these things are pretty obvious and straightforward but it sometimes just doesn't cross my mind. I guess it comes with experience and you gotta actually understand how Java works too :) . Thanks again!
How to spawn an enemy between two y coordinates 550 and 600?
By KeLLox, with 1 reply.
Replied to by danpost, almost 5 years ago:
<Code Omitted>
Weird GIF Images Scaling results
By AnJoMorto, with 2 replies.
Last reply by AnJoMorto, almost 5 years ago:
The thing is I can't figure out how to always get back the original image to scale it, since it's all changing GIFs
Scrolling world problem
By Genota, with 4 replies.
Last reply by Genota, almost 5 years ago:
Okay, now it works. Thank you!
Count act rounds
By Philinö, with 1 reply.
Replied to by danpost, almost 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, almost 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ö, almost 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, almost 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, almost 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:
87
88
89
90
91
92
93
X