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 you make a high score counter?
By GP2, with 3 replies.
Last reply by danpost, about 11 years ago:
GP2 wrote...
ok have looked into the UserInfo class and I'm a little confused on how it works do I have to make a .csv file or something?
No -- the UserInfo class of greenfoot does that for you. You only need to call the 'store' method on a modified (or un-modified) UserInfo object returned from 'UserInfo.getMyInfo()'. As the documentation states, however, you must first make sure that the user is logged in and storage server is available with 'if (UserInfo.isStorageAvailable())'.
Help Constructor not working interchangeably
By vivabenfica4, with 1 reply.
Replied to by vivabenfica4, about 11 years ago:
NVM, got it!
Greenfoot: Image Pass?
By Mint_Greenie, with 4 replies.
Last reply by Mint_Greenie, about 11 years ago:
thanks
Set image depending on variable in another class
By Crystic, with 3 replies.
Last reply by danpost, about 11 years ago:
Have the dummy actor set (or finalize) its image in an 'addedToWorld' method. Please refer to the Actor class API documentation for information on this method.
how do you do a time counter
By MBX5, with 5 replies.
Last reply by Entity1037, about 11 years ago:
@Gevater_Tod4711 Oh... good to know.
Can not longer place my units.
By CalzoneCannon, with 33 replies.
Last reply by danpost, about 11 years ago:
You need to post your error message (copy/paste it) and show the Sun class (if that is indeed where the error is occurring).
Better Layout for my GUI
By JasonZhu, with 1 reply.
Replied to by danpost, about 11 years ago:
You need to make a higher level component that is top-down containing two lower level components -- one with the cards that is left to right and one with the control panel which is left to right.
Have a question with sidescrolling
By n1nikko, with 3 replies.
Last reply by danpost, about 11 years ago:
No. The scrolling is something that should be done in your subclass of world (your ScrollingWorld class) -- even determining if scrolling should be done. The player should be programmed as normal (without respect to scrolling at all). Your code:
i have some problems with somthing i am doing
By 987987aris, with 1 reply.
Replied to by davmac, about 11 years ago:
It's just one error. At line 16 of your PlayerPink class, you are dereferencing a null reference. That is, you have obtained a null value and are trying to call a method on it (or access a variable with it).
java.lang.NullPointerException
- is the type of the error
at PlayerPink.act(PlayerPink.java:16)
- tells you where it happened The rest:
at greenfoot.core.Simulation.actActor(Simulation.java:568) at greenfoot.core.Simulation.runOneLoop(Simulation.java:526) at greenfoot.core.Simulation.runContent(Simulation.java:215) at greenfoot.core.Simulati
Enemies with A.I.
By exifern, with 8 replies.
Last reply by exifern, about 11 years ago:
Alright,thank you
Error message help
By Gingervitis, with 6 replies.
Last reply by Gingervitis, about 11 years ago:
That actually worked. My loop had a wrong value in it. Thank you for the help!
Help With Paint Order Of Individual Objects
By GunShow124, with 4 replies.
Last reply by danpost, about 11 years ago:
Your null pointer was probably due the 'getWorld' not being able to get the World object that the actor was in after it was removed from the world. Get a reference to the world before removing the actor: <Code Omitted>
Use var from method in act() in world class
By mrunknown, with 31 replies.
Last reply by danpost, about 11 years ago:
If you use 'static' fields and methods in your Main class for the scores and names, you will be able to change them directly from the Plane class using 'Main.staticMethodName()' or 'Main.staticFieldName'. My
Pushy Woman
scenario has an example of how that works in the Maze class (I think that is where the 'static' fields for best scores are located).
How to remove a JButton from my card layout.
By JasonZhu, with 3 replies.
Last reply by JasonZhu, about 11 years ago:
It works wonders. It beats deleting then having to replace the button by a long shot. Thanks a lot.
How do I let new snake circles follow the first one?
By Osso, with 1 reply.
Replied to by danpost, about 11 years ago:
One thing, first. In the act method, you are using both 'move' and 'setLocation'. You need to use one or the other, but not both; and, the preceding code should be geared toward that end. You should get the movement right for the head of the snake before moving on to trying to move an entire 'multiple section' snake. Since you are using only NORTH, SOUTH, EAST and WEST directions, using 'setLocation' with 'dx' and 'dy' would be the way to go.
673
674
675
676
677
678
679
X