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
Buttons removing blocks at a distance
By Ned_Chapers, with 1 reply.
Replied to by danpost, over 11 years ago:
If each button you touch removes just one block, then you can have each button hold a reference to the block it is to remove: <Code Omitted>Then, in the world, when creating the actors, create the blocks first and then create the buttons. Use something like this:
incrementing the scoreboard
By sammyyyyyy, with 8 replies.
Last reply by winnerpig, over 11 years ago:
danpost wrote...
Line 16 assigns 'thePattyCount' field one PattyCount object and line 17 puts a different one in the world. The one in the world is not the one being incremented and you will not see the incrementing of the one that is. Restrict your code to only one 'new PattyCount()' and you should be fine.
All right! You should just change the code in Line17 like this: <Code Omitted>
Make my Objects Switch worlds
By sun12, with 3 replies.
Last reply by sun12, over 11 years ago:
Nevermind I got it. HOW DO I MAKE THE GAME HARDER TO PLAY? WHAT CODE SHOULD BE WRITTEN
How to make method run only once?
By jennipho, with 2 replies.
Last reply by jennipho, over 11 years ago:
BLESS YOU THANK YOU SO MUCH
Can someone help me with my game?
By sun12, with 12 replies.
Last reply by sun12, over 11 years ago:
public void stack() { Actor a = getOneIntersectingObject(Ingredient.class); if ((a != null) ) { System.out.println(((Ingredient)a).name); //getWorld().addObject(a, this.getX()-50, this.getY()); //if (stackW != 1) Ingredient x = new Ingredient(((Ingredient)a).name); getWorld().removeObject(a); getWorld().addObject(new Ingredient("Tomato"),50,50); { getWorld().addObject(x, this.getX()-50, this.getY()+10); getWorld().removeObject
Gui Arrow Button Help!
By alpensan, with 10 replies.
Last reply by danpost, over 11 years ago:
The button objects retrieved from the world are not cast as Button1 and Button2 types -- they are returned as Object types. Use this instead: <Code Omitted>
')' expected
By MrFlesh, with 2 replies.
Last reply by MrFlesh, over 11 years ago:
Thank you very much Super_Hippo
Need help urgently! Stuck in infinite loop
By DialUp, with 3 replies.
Last reply by danpost, over 11 years ago:
Using only the methods given above (with loops and ifs, etc), there is no shortcut way to detect when to call 'stop'. Therefore, you must code 'if' within 'if' for each direction until either a leaf is found to eat or all directions are exhausted. Something like this:
Problem with GreefootSound
By 0gener, with 4 replies.
Last reply by 0gener, over 11 years ago:
Oh thanks it's working now
infinite loop problem
By fejfo, with 3 replies.
Last reply by danpost, over 11 years ago:
Are you getting an error message when it stops? if so, what is it? (copy/paste in entirety)
URGENT HELP PLEASE!!! IMAGES ARE NULL!
By Hades, with 3 replies.
Last reply by Hades, over 11 years ago:
wow, thanks! I didn;t realize that defining them like that would cause such a confusion. I had them defined because my code was pretty long and i got lazy when it came to typing it out literally :) Thanks again!
Need help urgently! Stuck in infinite loop
By randombruh, with 3 replies.
Last reply by randombruh, over 11 years ago:
Thanks for help guys I figured it out, but thanks :)
Using Variable from another class
By maddi64, with 1 reply.
Replied to by danpost, over 11 years ago:
Line 11 will never be executed. The 'if' condition at line 7 will always be 'true' because you are actually assigning 'true' to 'direction' within the 'if' conditional part of the statement itself (direction = true). To just compare the value of 'direction' to 'true, use the conditional equality symbol ('==') of a double equal sign (direction == true). Because 'direction' is a boolean value in itself, you can just use its value as the condition, 'if (direction)' or 'if (!direction)'. Furthermore, after correcting that, you will find that the logic of the 'act' method would say to set the v
Please help!! I keep getting error messages
By apoint93, with 5 replies.
Last reply by Super_Hippo, over 11 years ago:
If all images have the same file suffix, you can also use (for example): <Code Omitted>
Pure Java Version hangs on splash screen (OS X 10.10)
By guckuck, with 6 replies.
Last reply by guckuck, over 11 years ago:
Found it. The Shell-Script itself. Thanks again.
580
581
582
583
584
585
586
X