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
Searching Strings
By Hersov, with 9 replies.
Last reply by danpost, over 10 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, over 10 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, over 10 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, over 10 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, over 10 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, over 10 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, over 10 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, over 10 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, over 10 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, over 10 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.
Getting an x and y location from actors in a neibours list
By AndrewHollahan, with 7 replies.
Last reply by davmac, over 10 years ago:
Lastly I wasn't aware that the neighbours command was a square, it said radius so I assumed it was a circle thank you for the info.
The documentation doesn't say radius at all. It says:
Return the neighbours to this object within a given distance. This method considers only logical location, ignoring extent of the image. Thus, it is most useful in scenarios where objects are contained in a single cell. All cells that can be reached in the number of steps given in 'distance' from this object are considered. Steps may be only in the four main directions, or may
Changing Java Source in Greenfoot projects
By kOmaster476, with 5 replies.
Last reply by danpost, over 10 years ago:
I was thinking along the following lines when dealing with Strings in a switch block. Let us say you were doing a chess program and you had the pieces hold their types in Strings. Then, instead of: <Code Omitted>you could do this: <Code Omitted>
HELP! Transferring score counter from level 1 world class to level 2 world class while still keeping score
By Starmadero, with 4 replies.
Last reply by danpost, over 10 years ago:
Well, if you are not going to maintain a common place for the fields and methods, then you will have to determine the type of world each time a method or field from any world is accessed. For example: <Code Omitted>You can continue with 'else if' blocks for other world types. In a similar manner, this will have to be done everywhere y
replace object with another object
By bladerunner2nd, with 12 replies.
Last reply by danpost, over 10 years ago:
bladerunner2nd wrote...
i have different codes for removing the fish: for example if you eat it or it just reaches the left corner of the game; and the bloodstain should disappear after the animation or if it reaches the left corner too; i don't just want one removing code
Well, it can be done both ways -- as two separate removing codes or as two separate conditions within the same 'if' that removes the actor. That is:
Card Game
By largowinch123, with 3 replies.
Last reply by danpost, over 10 years ago:
The Java tutorial page on
The List Interface
might be helpful (in more ways than one). You may as well want to check out the link at the bottom of the page for the 'Algorithms' page.
615
616
617
618
619
620
621
X