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
Select box code not working
By excitedbubbles, with 1 reply.
Replied to by nccb, about 7 years ago:
One thing is that PlayerDeath is never set back to false. I'd also be careful generally about using static variables in the world -- as far as I remember, they are not reset when you click Reset, only when you recompile. This affects PlayerDeath but also leftSide etc. Instead of using ImageScrollWorld.leftSide, use getWorldOfType(ImageScrollWorld.class).leftSide and remove the static.
Hey, just wondering how to make counter work across lost of worlds
By AmyIsBadAtCoding, with 8 replies.
Last reply by AmyIsBadAtCoding, about 7 years ago:
Now it's throwing a hissy fit, the world constructor threw an exception. It doesn't like lines 21 and 44 saying: java.lang.NullPointerException
Help Witch This Code
By gacha321, with 12 replies.
Last reply by gacha321, about 7 years ago:
My bad :((( but, thank you for your helpp it works!
This line here has an error at .Hancur((Battleship)actor).Hancur();
By HotIce, with 2 replies.
Last reply by HotIce, about 7 years ago:
Nevermind I have solved it, thanks for any help
Counter for a pong game?
By awan16, with 2 replies.
Last reply by awan16, about 7 years ago:
danpost wrote...
The
leftCounter
field in your
Ball
class has issues. First, it is never assigned a
Counter
object -- namely, the one created and added into the world at lines 43 and 44 and referenced at line 12 in the
background
class. Since it is already referenced there, it might be best to remove line 7 in the
Ball
class and replace line 18 with the following: <Code Omitted>
Wow that works perfectly! I just stuck it in my WinLeft method and everythin
Using an int of another class
By loldertroll, with 7 replies.
Last reply by loldertroll, about 7 years ago:
no but i already fixed that
Mouse clicked in a certain area
By loldertroll, with 7 replies.
Last reply by loldertroll, about 7 years ago:
didnt work
I am unable to find the error referred to in the terminal window
By suzbo, with 2 replies.
Last reply by suzbo, about 7 years ago:
Thank you so much.
moving a dog bone to create a dog bone pile
By suzbo, with 3 replies.
Last reply by suzbo, about 7 years ago:
Perfect - I adjusted the X and Y axis locations, added a higher random number, added randomness to X axis, and achieved the final outcome of a pile of bones - thanks for all your help!
Updating Fullscreen Project
By Wasupmacuz, with 8 replies.
Last reply by Wasupmacuz, about 7 years ago:
nccb wrote...
Ah yes, sorry I forgot that it was a Java 11 method. We're currently testing Greenfoot 3.6.0 which will be based on Java 11, which should be out in a week or two.
Oh, okay. Thanks for the info!
Null Pointer Exception
By ChaosPhantom7, with 1 reply.
Replied to by danpost, about 7 years ago:
ChaosPhantom7 wrote...
Getting a null pointer exception with getWorld().addObject() << Code Omitted >>
Please provide entire error terminal output this code produced.
Spawn another Actor if a certain Actor is removed
By loldertroll, with 6 replies.
Last reply by danpost, about 7 years ago:
loldertroll wrote...
<< Code Omitted >> this is the code , it might help. (Spinne is the boss and jim is the player)
You are probably not putting the attempted codes in the right place. Try within an
act
method.
Character Dash
By loldertroll, with 2 replies.
Last reply by loldertroll, about 7 years ago:
danpost wrote...
Sure -- pause the scenario and drag it with your mouse. No -- seriously. You will need an
int
timer field to regulate the dashing time. A positive time value means it is dashing. Also, you will need a
boolean
field to track the state of the trigger key so holding it down will not cause constant dashing. All you should need to do when triggered is set a positive value to the timer. The act method should check the timer value and have it count down when positive.
ty
Help With Inputting and Showing Data File Formated .txt
By gacha321, with no replies.
I'm sorry but I have problem with my FarmGame again :((( in this case, my game must can inputting data to file formated .txt and can show that if we choose the "Look our Plants" list. I tried so many times and exactly it doesn't work at all :(( So, before we want to buy, sell or show our plants, we must walk to garden first, when we touch the garden it would showing us 3 lists, 1. Buy Plants; 2. Sell Plants; 3. Look our Plants; when we choose the 1st list, so it would be go to the BuyPlants World that show us 3 lists of Plants (Grape, Guava, and Manggo) wich have a sell price. when we wan't to buy the Plants, I make a 3 buy button for the Plants, we concern to the buy button in Grape (Button4).. I tried to code and I just have the code like this.. <Code Omitted> There's no error when compiling that code.. but when I tried to click the button, this is no act :(( there's no ChaChing sound and also the code like useless.. :(( I don't know where's the problem... After that, I tried to code for the 3rd list.. (Look our Plants) I tried to code like this in (List3.class) <Code Omitted> But.. it has an error that shows unreported exception java.io.FileNotFoundException; must be caught or declared to be thrown in this code... <Code Omitted> I don't know what must I do then :(( I tried to code this in 2 days and I don't know It's right or wrong because It doen's work in my game ;)) If you have a suggest or know what's wrong with my code.. please reply this.. your help is very very meaningfull for me ;))
Mass to health ratio
By Çðæyœn, with 3 replies.
Last reply by Super_Hippo, about 7 years ago:
I have no experience with using external files, so I can't help you with that one. What I would do instead would be to use the UserInfo class. Which obviously doesn't work easily for two-play-games like you described because you can only read other user's data but don't write anything to their files. Sending it over is probably more complex than figuring that I/O out.
179
180
181
182
183
184
185
X