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
height of world from world class
By davemib123, with 1 reply.
Replied to by davemib123, about 10 years ago:
nevermind no longer needed.
Make an invisible actor visible with getObjectsInRange
By ecorlette, with 2 replies.
Last reply by danpost, about 10 years ago:
Better would probably be to just use the transparency factor of the image. Then, there will not be any images going to the garbage collector and there will not be any need for the boolean, either (you could check for the current transparency value of the image, but even that is not necessary). The following line should be sufficient: <Code Omitted>
Rookie dilemma - setRotation randomly constructor
By chalkwharf, with 1 reply.
Replied to by erdelf, about 10 years ago:
The
setRotation
method is simple and just requires an integer. Well you need a random rotation, so we could use the Random method java provides, but Greenfoot already does that, so you can just call
getRandomNumber(int)
. Check out the links to the api and if you need further assistance, just answer here. Edit: forgot something. The constructor is basically a normal method that get's called to create th
Game Not working? un-findable error
By IgnisDragon, with 4 replies.
Last reply by IgnisDragon, about 10 years ago:
I'll upload when possible
Making something move randomly across the x axis.
By spider65, with 6 replies.
Last reply by erdelf, about 10 years ago:
spider65 wrote...
How would i make an object move across the x axis? The object should be moving across randomly. Please explain it to me in basic terms.
I guess you don't want finished code. So basically look at
this
and
this
. Combine them and it should give you what you want, if I understood you correctly.
shortest path
By NIRO17, with 1 reply.
Replied to by danpost, about 10 years ago:
My major concern is that I do not see any place in your code where any orb1 objects are being created and added into the world. As such, the act method of the ob1 class will never execute and the values of 'objX1' and 'objY1' will remain at zero forever. My next concern is that if you are to have more than one ob1 object in the world at any time, then the values of these fields will only point to the location of a specific one and its relative closeness to the Robot1 object will not be accounted for. As each one pointed to is removed from the world, the values will automatically point to so
grabing item
By NIRO17, with 8 replies.
Last reply by NIRO17, about 10 years ago:
can i combine MADKIT or JADE with greefoot and work together?
similar senario like ant senario
By NIRO17, with 12 replies.
Last reply by NIRO17, about 10 years ago:
thanks a lot
Greenfoot Freezes Altogether
By elektrikpulse61, with 20 replies.
Last reply by danpost, about 10 years ago:
elektrikpulse61 wrote...
since the movement is all done within one act cycle, the parent tank will not have moved any since it "fired" its last Trajectory object. Therefore, if the parent is returned a character as the "bumped into" object (the parent is also a parameter, allowing the Trajectory object to send information to the original tank), it will just fire wherever it is currently.
I missed this earlier -- maybe I was not quite sure what your trying to say. It appears you are trying to say that the parent will instantly be found to be an object within the trajectory path and, of
problem with getOneIntersectingObject
By bernhard, with 2 replies.
Last reply by bernhard, about 10 years ago:
Thank you for explaining, works just fine now. :)
Using a time counter to spawn 'medals' in gameOver world
By Exelious, with 6 replies.
Last reply by Exelious, about 10 years ago:
Works perfectly, thanks a bunch! :)
NullPointerException
By dougla, with 2 replies.
Last reply by dougla, about 10 years ago:
Thank You!
Problems with setImage method
By OfficerJelloKangaroo, with 1 reply.
Replied to by danpost, about 10 years ago:
OfficerJelloKangaroo wrote...
< Code Omitted > We never know if the win image will appear or if the lose image appears. When I commented out the setImage method it seemed more reliable. any thoughts on what might be the problem.
How can a win or lose image appear when the line is commented out? You must have code elsewhere in your project that is relevant here.
Refactoring
By hawkeye, with 1 reply.
Replied to by danpost, about 10 years ago:
hawkeye wrote...
Where is the section talking about refactoring to design patterns?
Please elaborate. This is quite cryptic.
Bubbles Lab
By rc5pn, with 4 replies.
Last reply by danpost, about 10 years ago:
rc5pn wrote...
yes, I understand i need to use the second bubble constructor in the Bubble class. But I guess I am a little confused on where I should put the following code to change the size of the bubbles by ten; in the Bubble constructor in the Bubble class? < Code Omitted >
If you want them to be placed in the world at the start, then you would want it in your world class constructor; or, if the 'setup' method is called from that constructor, you could place it in that method.
449
450
451
452
453
454
455
X