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
Arranging Actors
By Matt, with 1 reply.
Replied to by danpost, over 13 years ago:
Use the setPaintOrder method. Check it out in the Greenfoot API, in the World class. That will at least help straighten out the different classes; however, will not help with actors of the same class. To make them show over others of the same class, save its location, remove it, and add it back into the world. <Code Omitted>
Changing speed of an actor :)
By Matt, with 2 replies.
Last reply by danpost, over 13 years ago:
Your setDirection() code can be reduced to: <Code Omitted>
Greenfoot, Animation
By Matt, with 5 replies.
Last reply by Matt, over 13 years ago:
THANKS! everything works exactly how I wanted it to
Score per second help please!
By horyna, with 9 replies.
Last reply by SPower, over 13 years ago:
You're welcome :)
Ending a game
By Matt, with 1 reply.
Replied to by SPower, over 13 years ago:
Sure: <Code Omitted>Do this in act(). Replace theXCoordinate and theYCoordinate by numbers, which are the coordinates of the location you want to hit.
static images - multiple tile sets
By matt.milan, with 5 replies.
Last reply by davmac, over 13 years ago:
Just to explain something else you may have missed, line 18 from your original post: GreenfootImage expandedImages = imgs; ... doesn't make a copy of the array, it just creates another reference to it. So the following lines: imgs = expandedImages; imgs = expandedImages; ... are either redundant (first line above) or modify the original array (second line above).
Instance Variables
By Loopy, with 3 replies.
Last reply by Loopy, over 13 years ago:
Thank you danpost. I was able to get my questions answered!
Is there something about getOneIntersectingObject() that I don't understand?
By darkmist255, with 3 replies.
Last reply by darkmist255, over 13 years ago:
Wow... Thanks davmac, I can't believe I didn't notice that! That would explain the character sinking into the ground since he's taller than he is wide... Well I think from now on I'm not just going look for what might be wrong with how I'm doing it, I'll look for typos first :D!
How do I make a boolean?
By h123n, with 5 replies.
Last reply by h123n, over 13 years ago:
thanks that helps
How to perform a task once and only once.
By Loopy, with 7 replies.
Last reply by trash1000, over 13 years ago:
The exclamation mark translates to 'not'. Like in "if
not
dancing".
Problem calling methods of actors from other actors
By Scoter_man1, with 3 replies.
Last reply by Scoter_man1, over 13 years ago:
Thanks! That's helping me with so much more than just that one issue.
"world cannot be cast to world2" Why?
By KevDog32, with 7 replies.
Last reply by danpost, over 13 years ago:
Seems to me, it would probably be a Java bug, if it is a bug at all. Though, Greenfoot is the one throwing the error and saying that a close parenthesis is needed.
Invoking a Method
By Julian, with 9 replies.
Last reply by davmac, over 13 years ago:
When I was learning OOP (after first learning procedural programming) I found it helpful to think of instance methods as having a hidden first parameter, which was the target object, or 'this' in Java-speak. The parameter isn't declared but it is implicitly present in any instance method. Of course, you are able to access fields and methods of this parameter without qualifying them with an object reference (because 'this' becomes an implicit target reference for anything which can't otherwise be resolved). In my head, expressions such as: someObject.someMethod(3, 4); Became: so
Jumping/Falling Issues.
By kdnkdn12, with 5 replies.
Last reply by FallenPhoenix, over 13 years ago:
mik wrote...
Not seeing all the details, I'd say that this line looks suspicious: getOneObjectAtOffset(0,1,Ground.class) You check for ground only one cell below your jumping actor. (That is: one cell below the
centre point
of your actor!) If your cells are small (i.e. one pixel) and if your actor is large (i.e. more than one pixel) then you will detect ground only once the centre of the actor touches the ground object. You need to use a greater y-offset to check near the feet of your actor (for example: getImage().getHeight()/2 ). Also, even if you detect ground correctly,
Help?
By Serhil, with 5 replies.
Last reply by SPower, over 13 years ago:
@davmac That's what I tried to say :)
977
978
979
980
981
982
983
X