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
How to make an actor move only when an other actor intersects
By sjoerdieman, with 2 replies.
Last reply by danpost, almost 12 years ago:
Also 'Counter' for a field name has multiple downsides. First one thing, by convention, field names should begin with a lowercase letter. For another, the name does not remotely describe what the field is for -- you are not using it as a counter, but more as a direction indicator. Better would be to use it for the direction itself, which can be found at the end of lines 11 and 14 -- '-1' and '1': <Code Omitted>You will n
turnTowards oddity
By DoWhileNot, with 3 replies.
Last reply by danpost, almost 12 years ago:
DoWhileNot wrote...
I see what you mean. The solution for the hardware limitation looks like it's already been worked out though, using Vector and the SmoothMover subclass of actor.
That is what those classes were designed to do (particularly the SmoothMover class).
PLEASE HELP!!! Shooting an opponent is failing!
By jamesyu415, with 7 replies.
Last reply by danpost, almost 12 years ago:
Please show your revised bullet code.
How to let an object 'slide' after a movement?
By AnthonioBanderas, with 6 replies.
Last reply by Super_Hippo, almost 12 years ago:
Did you import the Smooth Mover class and have the SpeedBoat extend it?
security
By actinium, with 5 replies.
Last reply by danpost, almost 12 years ago:
Maybe its your browser security :?
Searching Strings
By Hersov, with 9 replies.
Last reply by danpost, almost 12 years ago:
@Super_Hippo, I had realized that you already knew this after re-reading the first couple lines of your post. It was just that the code you supplied had the incorrect indecis for changing the 'L' to an 'A'.
Proplem with getOneIntersectingObject(class)
By fejfo, with 3 replies.
Last reply by fejfo, almost 12 years ago:
I didn't mean there was a porblem with getOneIntersectingObject(class) but that I had a problem using getOneIntersectingObject(class) and I made it that attack() never is gonna execute : <Code Omitted> (in public void act() ) but know know I have to test in the method:)
cant see my greenfoot actors and the world itself
By khalid11, with 2 replies.
Last reply by khalid11, almost 12 years ago:
wow it worked ,ive been trying to fix it for about a week thank you very much
Image not changing
By actinium, with 2 replies.
Last reply by actinium, almost 12 years ago:
Lol, stupid me, how did I not notice that void. Cheers danpost time for bed me thinks.
Switching Image based on actor location
By Dillybar, with 8 replies.
Last reply by Dillybar, almost 12 years ago:
Awesome, I got a working version. Thanks much for the help
Need help with spawning a wall at given location
By SJ15, with 3 replies.
Last reply by danpost, almost 12 years ago:
Well, the Actor class has a 'getImage' method which returns a GreenfootImage object and the GreenfootImage class has a 'setTransparency' method. Refer to the class documentations.
HELP
By largowinch123, with 1 reply.
Replied to by Super_Hippo, almost 12 years ago:
You can't call 'getWorld()' in a constructor because the constructor is called before the object is added to the world. Well, you can call that method, but it will return 'null' and you can't call any method (in your case 'addObject') on 'null'.
one-click jump
By DemonsWhiteSoul, with 1 reply.
Replied to by danpost, almost 12 years ago:
Each act cycle, you must determine if the actor is standing on anything or not. Allow jumping only if standing on something. My
Jump and Run Demo w/Moving Platform
scenario has viewable code. Run the scenario and click on the 'WHO' button; then, scroll to the bottom of the page to see an example of how to accomplish it.
Please help!!! :-(
By ILOVELABRADORS, with 1 reply.
Replied to by danpost, almost 12 years ago:
I need a better understanding of what you want, exactly. What part of the other actor has to be within 40 pixels (horizontally, vertically, or diagonally) of the hamburger ... the center of the actor? any part of its image? if the latter, is its image square?
Im new to greenfoot plz help
By DemonsWhiteSoul, with 3 replies.
Last reply by danpost, almost 12 years ago:
DemonsWhiteSoul wrote...
I got the walls to act like a solid now, i used the getOneObjectAtOffset etc. Only thing wrong now is i cant save the world :P
Explain. Give any error messages. Give details about unwanted behaviors. Supply code (use the 'code' link below the reply box to insert code into posts). Anything that might help resolve the issue. BTW, you can only save the world after compiling or resetting and making changes manually but before any act cycles have been executed.
617
618
619
620
621
622
623
X