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
One actor 2 times, Removing one
By sjoerdieman, with 1 reply.
Replied to by danpost, over 11 years ago:
You can add a reference field to the class to hold the added actor so you can remove it when the conditions are right (I presume at line 35): <Code Omitted>then when creating it: <Code Omitted>and to remove it: <Code Omitted>I am skeptical a
Help Needed With Score Going Up To 15
By Manda_x, with 6 replies.
Last reply by davmac, over 11 years ago:
Manda_x wrote...
nop, I don't understand.
lines 3-5 of what you posted in the Counter class, do not belong in that class. You need to put those lines at whatever point it is that you want to increase the count - that is, whenever your main actor collects a target. This will probably be in the main actor class.
File reading works in editor, but not after exported.
By EnderPicture, with 6 replies.
Last reply by davmac, over 11 years ago:
An applet does not normally have permission to read and write files on the local system, so you can't user FileReader as you do above. Also, the file when exported is inside the jar file that makes up your scenario, so it doesn't exist as a separate file. I do have an
example scenario
showing how you can read file contents from files embedded within your scenario, though.
Open the webbrowser
By sjoerdieman, with 2 replies.
Last reply by sjoerdieman, over 11 years ago:
Thanks got it!
How to zoom in when in source code view?
By classicjimmy, with 1 reply.
Replied to by danpost, over 11 years ago:
While in the editor, select 'Options>Preferences...' from the menubar; in the 'Editor' tab, change the font size to 14 or so and click the 'Ok' button. From outside the editor, you can get to the 'Preferences' dialog box by 'Ctrl-,' (control-comma).
Solid Objects
By DemonsWhiteSoul, with 4 replies.
Last reply by danpost, over 11 years ago:
DemonsWhiteSoul wrote...
How would i make it walk back? do i set Rotation ?
How does setting the rotation of the image that actor has change that actors location? There are only two Actor class methods that change the position of an actor. Please review the Actor class documentation (the methods available and what they do, in particular).
Multiple image movement
By Mrinal, with 6 replies.
Last reply by danpost, over 11 years ago:
If you were to code it in the Ladybug class, you would need a field to distinguish one from the other as far as which direction they will move. An int type field would be easiest in this case. One instance can have a value of '1' while the other has a value of '-1'. Then multiply both value parameters in the 'setLocation' statement by the field.
Offset Movement
By Mrinal, with 7 replies.
Last reply by Mrinal, over 11 years ago:
Made a little change in code and put it in. Works... Thanks a lot! :)
I'm making Brick Breaker/breakout and my ball is only coliding with the top of the bricks
By TTTT, with 3 replies.
Last reply by Super_Hippo, over 11 years ago:
You could just add an 'else' before the 'if' or do it like this: <Code Omitted> Or: <Code Omitted>
Help!?
By Greenfooter1212, with 4 replies.
Last reply by Greenfooter1212, over 11 years ago:
How would I put that in?
getOneObjectAtOffset....
By DemonsWhiteSoul, with 4 replies.
Last reply by DemonsWhiteSoul, over 11 years ago:
Thanks, you been soooo much help xD
Checks
By Kryptonous, with 43 replies.
Last reply by Kryptonous, over 11 years ago:
Still figuring out the turns, but I think that'll work out, eventually. Thanks danpost and Super_Hippo, you really helped me out a lot! I still have to learn so much, though!
Many, many thanks!
How to filter out the "Enter" character form a txt read?
By EnderPicture, with 1 reply.
Replied to by Super_Hippo, over 11 years ago:
Could you post the relevant code how you read the file? Maybe we can find the reason then. (Use code tags please.)
Setting movement of an object
By ryancumpsty, with 1 reply.
Replied to by danpost, over 11 years ago:
Please refer to
this page
of the java tutorials.
Movement!
By gamer98, with 4 replies.
Last reply by -nic-, over 11 years ago:
Yeah I know but I copied it from a test scenario and it threw an error otherwise forgot to get rid off it. Thanks Super_Hippo
607
608
609
610
611
612
613
X