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
How do I store a variable to a text file
By TechWebLock, with 1 reply.
Replied to by trash1000, almost 12 years ago:
Why don't you retrieve all the scores and save them back into instance variables when you start the game. Now a level ends and you check for the score to be higher than the one you just retrieved. If so you change the score and write it back into the file. Like you retrieve the scores into 3 instance variables - score1, score2 and score3 for example. Now the player beats level 1 - you check his score to be higher than score1, if so you set score1 to the player's score and write it to the file (the other levels go accordingly). Here are a few methods with which you can easily write variables
Picking Up Objects
By Denzien, with 6 replies.
Last reply by danpost, almost 12 years ago:
@kartikitrak, it appears you want code in the Coin class, for a coin to look for an intersecting coin; which, of course, is not what is wanted. In the class of the actor that is to collect the item, add the following method: <Code Omitted>and call it from the act method with (example is for coins): <Code Omitted>
Platforms which move up and down?
By dandefender2, with 1 reply.
Replied to by trash1000, almost 12 years ago:
Well, you have to decide when you want the platform to move up again. I'd say the easiest way is to use a boolean variable - if it's true you move down, if it's false you move up. <Code Omitted>This will cause the actor to constantly move up and down from the top world edge to the bo
<Identifier> expected
By fred, with 2 replies.
Last reply by fred, almost 12 years ago:
Thank you :)
Re-entering levels at different x,ys.
By dlanni, with 4 replies.
Last reply by dlanni, almost 12 years ago:
Yay! Lana now leaves Level2 Bedroom correctly !! I put all the code from this string and the other in. A few new problems: 1. Lana can't get out the front door at all. When she gets close to it ( probably y<100 ) she is flung back to beginning position (approx x=100, y=450.) 2. When this happens the front door closes!? 3. When she enters the Level 3 bedroom she can't get out ( well, probably she could get out by continuing left down the x axis and end up as if she just came from Level2) So I think that I need to add m
Greenfoot.isKeyDown()
By darkmist255, with 9 replies.
Last reply by darkmist255, almost 12 years ago:
Thanks, I had a feeling that Java just didn't like the numpad. I'll avoid these keys in the future.
How do I change the default world?
By darkmist255, with 2 replies.
Last reply by darkmist255, almost 12 years ago:
Ah, thanks!
Zooming in and out
By mcwell, with 4 replies.
Last reply by mcwell, almost 12 years ago:
I'll give that a try Builderboy. Thanks for the help guys
Reliably playing sound in Greenfoot
By triss, with 5 replies.
Last reply by davmac, almost 12 years ago:
On Mac OS X, the Java version is essentially fixed - it's updated along with other OS components, so it's generally difficult to get into a situation where you have a really old Java version; in any case, though previous Java-for-mac versions have had "issues" with sound, they've generally not had the problems described above. (Also, Java 7 isn't available for OS X 10.6).
broken link on docs page
By triss, with 2 replies.
Last reply by davmac, almost 12 years ago:
I'll look into this too.
has the web site been updated
By tylers, with 5 replies.
Last reply by davmac, almost 12 years ago:
Yep, I'll fix that soon. Thanks.
Displaying Images
By Matt, with 8 replies.
Last reply by danpost, almost 12 years ago:
It might have to do with line 10, which probably should be: <Code Omitted>Also lines 9 and 11 need removed.
Custom font
By GregC246, with no replies.
I used a custom font in my game, and although it works in the editor perfectly, the standalone executable uses the default font, even though the file for the font is in the .jar.
Sorry about so many questions.
By dlanni, with no replies.
Lana's House is my final project for Java 1 and is due tomorrow ( Wed 5/23 ).
help with sound
By martijn13039, with 4 replies.
Last reply by martijn13039, almost 12 years ago:
Nccb that was the problem thx for the help and quick respond it is working fine now
960
961
962
963
964
965
966
X