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
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.
Help - storing scores in a text file
By Leenza, with 3 replies.
Last reply by fejfo, over 11 years ago:
in the begining I had a lot of trouble with this to but I made an IOhelp class and now I understand it you can take a look at it
How can i put my program up here?
By changchiyou, with no replies.
i made lots of char and all of them have their own program, can i put on here in a easy way?
Colliding
By aliozkan, with 45 replies.
Last reply by aliozkan, over 11 years ago:
I did it by putting everything in the act method to a 'everything()' method then I did if else statement (this != null), if part is time is ticking, else part is it is not. So it is working. I had some issues on printing the time in the middle on the scoreboard and removing the other one but now I figured it out. But... I have another problem actually not a problem but a improvement, so I have 5 different enemy planes in the game and I used this for giving numbers to them. <Code Omitted>But now I wanted do them increasing a
Location
By MrGigglesII, with 1 reply.
Replied to by danpost, over 11 years ago:
Please elaborate. It may be that the one class should not extend the other. Say you have a ClassA and a ClassB. If you cannot say a ClassB object is a type of ClassA object, then ClassB should not extend ClassA. For example, if I had a Car class, I can extend it with Sedan, Coupe, and Wagon (these are types of cars); but I should not extend it with Bicycle, WindShield or Truck (these are not cars). However, with the code provided, it looks like you are trying to set field values 'x' and 'y' by calling a method that requires the actor be in the world. These fields are created and ass
580
581
582
583
584
585
586
X