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
Animating an Attack
By iminblue, with 4 replies.
Last reply by iminblue, almost 7 years ago:
danpost wrote...
iminblue wrote...
How can I change the code in order to 'normalize' the movement speed ? I'm talking about the character going faster in diagonal
You could use a smooth mover support class.
I don't know what that is but I somehow solved the problem anyways . Thank you very much
image in other class
By Simson1000, with 6 replies.
Last reply by danpost, almost 7 years ago:
Simson1000 wrote...
and with a variable?
Yeah: <Code Omitted>
Greenfoot 3.5.3 release
By hiteckh, with no replies.
Hi All, We are pleased to announce our new release of Greenfoot 3.5.3 which you can download from https://www.greenfoot.org/download. The main fixes in this release are the memory leak that noticed when using large actor/world images (which caused Greenfoot to slow or crash) and other bugs related to indentation and copy/cut line functinoalities. We recommend everyone to upgrade to this version and let us know your comments and feedback which are always helpful and appreciated.This release continues using Java 8 and we have plan in the future to move to Java 11. Thanks!
how do I post a scenario?
By Ipurplish, with 1 reply.
Replied to by danpost, almost 7 years ago:
Ipurplish wrote...
I finished a game that I am very proud of. do you know how I could put it on the greenfoot website for people to play?
(1) Open the scenario in greenfoot application; (2) Click on
Share
button (top-right corner of frame); (3) Select
Publish
tab (prompt text should read something like "Publish to greenfoot site"); (4) Adjust setting and fill in information; and finally, (5) Click on the
Share
button.
How do I change the MyWorld Image MidGame?
By Ipurplish, with 3 replies.
Last reply by danpost, almost 7 years ago:
Ipurplish wrote...
what is it then?
Please refer to the
World class documentation
.
Unsure how to make certain loop
By Ni3ls, with 1 reply.
Replied to by danpost, almost 7 years ago:
Unless I entirely misunderstand what you are wanting to do, I do not see why you would need a loop. On any given act step, the value of the
shotDelay
field will only go down once. If its value is not negative, you will only add one extra block into the world. On any act step a shot is fired, you would just remove all the blocks from the world. None of these actions requires a loop on your part.
setSpeed() for a single Actor
By coreXtream, with 2 replies.
Last reply by danpost, almost 7 years ago:
I guess the other possibility is to double the width and height of the world and halve the cell size. Then, without changing the size of the images, you can have the bullet move faster. Actually from 21 x 14, you can go to 43 x 29, place and allow turning only on odd valued x- and y-coordinates so as not to really change anything other than non-bullet objects "half-stepping" it. This would also solve the bullet/edge issue. Restrict the rover and other non-bullet objects to x >= 1, y >= 1, x <= world width -2, and y <= world height - 2.
How do you detect a click in an area on the world
By TobyRoby, with 10 replies.
Last reply by TobyRoby, almost 7 years ago:
awesome, thank you very much you beautiful greenfoot user <3
How can I restart a loop early?
By lm_s, with 3 replies.
Last reply by danpost, almost 7 years ago:
I think you may have a misunderstanding about the way the act method works. You need to program it for what you want done at each instance of time. The act method is repeatedly called while your project is in a running state -- which is like the initial animation loop. Assuming that there will always be a right or left path to go if not able to go forward: <Code Omitted>should be sufficient. A choice would need to be made if left and right were both possible ways to go. You can repeat line 2 (copy/
How to check if you have detected a different color
By pablo0826, with 3 replies.
Last reply by danpost, almost 7 years ago:
pablo0826 wrote...
<< Images Omitted >> Above are images of my world before and after running the program. And below is the code for the lander. << Code Omitted >>
What is the size of your world? what is the size of the image assigned to the
Mountains
class? and, where was your
Mountains
object addied into the world at? Do you have scrolling implemented? You may want to track the location coordinates of your Rocket object as double values so as not to lose precision (makes for smoother acceleration/deceleration).
how to make actor react on noise through microphone
By Dhiraj, with 1 reply.
Replied to by danpost, almost 7 years ago:
Use the
Greenfoot.getMicLevel
method. If the returned value is less than a certain value, move right as normal, otherwise (
else
) move left. Btw, the commented text in the code reads moving left is normal and move right when noise is being made.
Swapping Actors in a 2d array
By M123D, with 1 reply.
Replied to by danpost, almost 7 years ago:
M123D wrote...
I'm trying to make a game based off of candy crush but I can't seem to get the swapping of the actors right. In my code, all the different coloured candies extend a Candy class and they are placed in MyWorld according to how many pixels apart they are.
Please show
Candy
class code and
MyWorld
class code.
PLEASE HELP ME FOR THE LOVE OF GOD
By Swangbee, with 4 replies.
Last reply by danpost, almost 7 years ago:
If the
HealthBar
object is contained by the
SpaceShip
object, then it would make good sense to have the space ship look for the Powerup object and not the other way around.
Get an actor to bounce back when egde is hit.
By Notted, with 7 replies.
Last reply by danpost, almost 7 years ago:
Notted wrote...
So, if this << Code Omitted >> is not setting the direction of the actor, will setRotation(), do the job? If not, what will?
Yes, but your actor will not the be upright. Just negate the speed of the actor.
I want to use the boundaries of the image as the bombs hitting the bucket. How do I do this, since I don't know?
First, see if there is an intersecting bomb. If so, then get the image and determine whether the location of the bomb is in the collectible region. The left edge of the basket would be at:
I have a question
By imdojangbob, with 6 replies.
Last reply by danpost, almost 7 years ago:
imdojangbob wrote...
What should I do with my animal class?
Personally, I would totally remove the
Animal
class from the project. I see only one "possibly" useful method in it (the
move
method) and it is not used in the
Human
class. All the others either have a method now in the
Actor
class that can be used in lieu of it (
canSee, eat, turn, atWorldEdge
); or, are badly written (
access, removeObject
); or, are related to poor design (displayMessage, clear). From a design standpoint, it would be better to use an actor, or actors, to display messa
217
218
219
220
221
222
223
X