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
awt event queue error
By xinzhaogg, with 1 reply.
Replied to by danpost, over 9 years ago:
xinzhaogg wrote...
this weird error appeared. Apparently, I am missing a reference pointer and the result prevents me from compiling/ running the game.
Please show the complete error output you got.
is greenfoot really programming?
By MasterProgrammer, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Yes, it is. Why not?
my game
By jacquelinereilly, with 7 replies.
Last reply by jacquelinereilly, over 9 years ago:
thank you!! easier than I thought, thanks so much
characters
By jacquelinereilly, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
With a gif image, there is a method which automatically gets the next image. You can obviously do everything which a gif image can with "normal" images and some code, too.
Check Boundaries heelp
By Hondrok, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
Add an int variable which you can use as a timer. Set it to some number whenever a shot is fired. Each act cycle, you decrease that number if it above 0 and only if it is 0, you can shoot. (Obviously you can also increase it and do it the other way around.)
need help with nullpointerexceptions
By brothermic, with 3 replies.
Last reply by Super_Hippo, over 9 years ago:
The constructor is executed when the object is created, before it is added to the world. That's why your 'world' variable is never anything else then 'null'. If you really want to save a reference to the world in your enemy class, you can add the 'addedToWorld' method: <Code Omitted> Maybe you can also use this (try it out, I am not sure): <Code Omitted>
Request info on sprites: height, width, and file path
By earnold, with 1 reply.
Replied to by danpost, over 9 years ago:
earnold wrote...
Just curious what the original sprite height and width dimensions are, and where those files are stored. Thanks!
You can find the images in the 'Greenfoot/lib/greenfoot/imagelib' folder.
`java.lang.NullPointerException` error
By dandrei279, with 8 replies.
Last reply by dandrei279, over 9 years ago:
I fixed it! I moved the 'Space a=(Space) getWorld();' line in act() when the user presses `SPACE`. Now everything works fine! Thanks Super_Hippo! Thanks danpost!
Setting Images
By Hondrok, with 2 replies.
Last reply by Hondrok, over 9 years ago:
Super_Hippo wrote...
You need to get a reference to it and then you can call the 'setImage' method on it.
Thank youu
Invalid Moves.
By KennethTheSuperMelon, with 2 replies.
Last reply by Super_Hippo, over 9 years ago:
When you get the target location, compare the x and y to the size of your world, so if it is negative or 8 or higher, instead of moving, you print out a message (or create an object which uses an image with the message).
Text Alignment on New Line
By Theangryman, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
I don't know if there is a more easier way, but I would probably create a new image for each line and then draw all these images below each other on one image which the object can use.
I used java scenario and i need to change it to stride scenario
By Benjy861, with 2 replies.
Last reply by Benjy861, over 9 years ago:
Or can some pro help me to translate the texts of java to stride?
AddPoints
By dendepen, with 1 reply.
Replied to by danpost, over 9 years ago:
You cannot set the Gardener field of the SprayWater object when you do not have a reference to the object. Do not create the SprayWater object in the 'addObect' line -- create it before the line, set the Gardener object reference in it and then add it to the world: <Code Omitted>
Why can't i add a 3th background in scrolling??
By Jochends, with 11 replies.
Last reply by danpost, over 9 years ago:
Jochends wrote...
With this code i can only put the 'Steen' on an 'X and Y' coördinate that is inside my screen '1000 pixels on 400 pixels, and not in the scrolling( outside the 1000 pixels ). <Code Omitted>
You have an unbounded world -- you can put any object anywhere regardless of whether on-screen or not.
i can put my object also INSIDE my scrolling world on the Y-Coördinate '357' and on top of the 4th 'steen' with the '(t==3), so that is fine also. But with what code can i put an object on a RANDOM Y-coördinate INSIDE my scrolling?
HELP! Confused on how to continue. if/then react to user input
By Stillinski24, with 10 replies.
Last reply by Stillinski24, over 9 years ago:
Thank you so much @danpost and @Super_Hippo my code worked!
407
408
409
410
411
412
413
X