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
Help needed with code
By YellowThundy, with 4 replies.
Last reply by danpost, over 11 years ago:
You need to explain what behavior you want for the forcefield -- how it should react with other objects (like the enemies). As is, the behavior is that the forcefield will move diagonally up and to the left quickly with each enemy in range. It could end up moving as much as two-thirds across the screen in under half a second (with just one enemy).
Creating chess game--how do I check when two objects overlap?
By needcodehelp, with 1 reply.
Replied to by davmac, over 11 years ago:
Please read
>this<.
(Hint: you can use getOneIntersectingObject or one of several other methods for this.)
HELLLLLLLLLP!!! (pretty please) For loop question!
By GreenfootNewbie, with 1 reply.
Replied to by danpost, over 11 years ago:
As far as deleting all the images manually placed -- no. Just re-compiling the project will remove them. As far as the code -- there was no mention in the instructions of any randomness; also, if they are to be placed horizontally across the top and across the bottom, there would be no change in the y coordinate for either the Me or the Face objects and dividing vertically by 8 has no bearing on the placement unless you want to use that value to place the rows of objects at that distance from the top and bottom edge. The 'for' loop parameters you are using will only produce 7 objects; t
why did I get this answer wrong?
By SOUPNAZI, with 7 replies.
Last reply by lordhershey, over 11 years ago:
Even with the fix the test question is still wrong. :/
Question confusion?
By SOUPNAZI, with 5 replies.
Last reply by danpost, over 11 years ago:
The problem is that the 'move' method provided by the Actor class has the signature 'move(
int
)' while the one in the Animal class has the signature 'move()'. You can use 'move(int)' from any Actor subclass (including the Animal class) because that method is defined in the Actor class; for the same reason, you can only use 'move()' from any subclass of Animal (or from the Animal class itself, since it is an editable class).
Actor not in world. An attempt was made to use the actor's location while it is not in the world.
By IronMagus, with 3 replies.
Last reply by danpost, over 11 years ago:
IronMagus wrote...
code: <Code Omitted>
Line 3 creates a new Hero object and line 4 tries to get its x coordinate in a world; however, it has not been added into any world (you may have a Hero object in the world, but it is not the same Hero object referenced here).
how do i make an actor class into an arraylist.
By 5mark7, with 10 replies.
Last reply by danpost, over 11 years ago:
You might be interested in the java tutorial trails. The second section on the left titled
Trails Covering the Basics
would be a good place to start.
Searching for someone to draw a png
By DerAstronaut, with 2 replies.
Last reply by DerAstronaut, over 11 years ago:
Thank you :)
how do I change rotation by 5 degrees?
By ipeefreely, with 1 reply.
Replied to by azazeel, over 11 years ago:
setRotation(getRotation()+5); or just turn(5);
whats the value of x after thie statement has been executed?
By SOUPNAZI, with 1 reply.
Replied to by azazeel, over 11 years ago:
x=0; y=4; x=y+3; // x = 4+3 = 7 x=x+2; // x = 7+2 = 9
Looping sound?
By NewToJavaPlt, with 2 replies.
Last reply by NewToJavaPlt, over 11 years ago:
thank you i got it
Urgent Help! "java.lang.StackOverflowError"
By Ariadia, with 6 replies.
Last reply by Ariadia, over 11 years ago:
Okay, thank you! :)
Shooting
By purplefoot, with 4 replies.
Last reply by danpost, over 11 years ago:
Or more simply: <Code Omitted>As an alternative to this way, you could put the following in your world class constructor: <Code Omitted>and then the deer will detect clicks on themselves without the crosshairs being in the way.
How to stop Actors moving off the world?
By Adam2323, with 6 replies.
Last reply by Adam2323, over 11 years ago:
Ohhhhh thank you :) It all works now.
Piggybacking another users question for help...clarification
By SOUPNAZI, with 1 reply.
Replied to by danpost, over 11 years ago:
The '-5' is not overriding the rule. It is an adjustment to the current transparency value: <Code Omitted>At this point, 't' is just an integer value, not a transparency value. <Code Omitted>This line checks to see if that value is less then zero. The value is set to zero if found below zero before actually setting the transparency of the image. To make an object blink, you need a timer. I think Super_Hippo just replied to someone about this. Check out some of the other most recent discussion threads.
564
565
566
567
568
569
570
X