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
Using a non-standard character set
By davemib123, with 3 replies.
Last reply by danpost, over 10 years ago:
davemib123 wrote...
Something like this? < Code Omitted >
No -- that would be akin to creating all 1000 images (except you would be coding for each 1000 values). More like this: <Code Omitted>where you put all ten digit images in an array: <Code Omitted>
height of world from world class
By davemib123, with 1 reply.
Replied to by davemib123, over 10 years ago:
nevermind no longer needed.
Make an invisible actor visible with getObjectsInRange
By ecorlette, with 2 replies.
Last reply by danpost, over 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, over 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, over 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, over 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, over 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, over 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, over 10 years ago:
thanks a lot
Greenfoot Freezes Altogether
By elektrikpulse61, with 20 replies.
Last reply by danpost, over 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, over 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, over 10 years ago:
Works perfectly, thanks a bunch! :)
NullPointerException
By dougla, with 2 replies.
Last reply by dougla, over 10 years ago:
Thank You!
Problems with setImage method
By OfficerJelloKangaroo, with 1 reply.
Replied to by danpost, over 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, over 10 years ago:
hawkeye wrote...
Where is the section talking about refactoring to design patterns?
Please elaborate. This is quite cryptic.
449
450
451
452
453
454
455
X