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
Counters
By sophiaking, with 3 replies.
Last reply by sophiaking, over 10 years ago:
THANK YOU IT WORKED
How to run a method only once?
By ProfessionalNoob, with 3 replies.
Last reply by danpost, over 10 years ago:
Working in your Cards class code (with the Generation method) above: If you are just trying to give an initial random image to the actor, change line 1 to <Code Omitted>Or, alternatively (if once the image is set, it does not change): remove lines 1 through 5 and change line 6 to the above line.
Heyy
By 60sChallange, with 1 reply.
Replied to by davmac, over 10 years ago:
60sChallange wrote...
Is it possible to upload greenfoot game on my website?
Generally, yes. Export your scenario to a web page, and upload the resulting files. and is it possible to sell it in any game store? Legally, you need to obey the restrictions of any software licenses that you are bound by. If you export your game using the "share" function from an unmodified official version of Greenfoot then there are no restrictions unless you use the mp3 support, which requires the JLayer library. In that case, read the JLayer license and seek legal advice if there i
how to make a car actor stop when the light actor sets its image to red light
By Rayray, with 19 replies.
Last reply by Rayray, over 10 years ago:
do not worry i didnt see you put addObject(light) i left it as New Light() thank you!!!!!!!!!!!!!
Method error
By sophiaking, with 2 replies.
Last reply by Super_Hippo, over 10 years ago:
sophiaking wrote...
<Code Omitted> in my counter this is an if statement that stops the counter once it reaches zero. for this met
Stopping a counter at zero
By sophiaking, with 6 replies.
Last reply by sophiaking, over 10 years ago:
Thanks that worked!
Score
By Tylon619, with 1 reply.
Replied to by danpost, over 10 years ago:
Please show what you have tried. Cannot fix unseen code. Use the 'code' link below the reply box to insert code into your posts.
Help W/Mining Project.
By LordDanicus, with 1 reply.
Replied to by danpost, over 10 years ago:
There are many scrolling engines available here. I have several up. My latest one,
Easy Infinite Scrolling Support Class
, is quite a simple one and easy to use. If you do not have a background image that needs to scroll, it would be perfect (the background scrolling engine of this particular support class 'wraps' the background image; however, the actors can scroll without the background. Another demonstration of its use is in my
Wombat Racing
scenario.
How do you add object within the constructor for the object you are adding?
By Diljot, with 13 replies.
Last reply by Diljot, over 10 years ago:
IT WORKS!! Yes! Thank you again for all your help!
Need help with an array
By kdbailey, with 1 reply.
Replied to by davmac, over 10 years ago:
Line 22: <Code Omitted> This creates a variable which can hold a reference to an array, but it doesn't create an array. Nowhere in your code is an array created, so there is no array; 'thisDeck' remains
null
. When you try to use it, you would get a NullPointerException. You need to initialise the variable with an array: <Code Omitted> (By the way, if you need help with an exception,
please
post the stack trace or at least say which line you get the exception on! This makes it much easier to diagnose.)
Help spawning into world of selected stages
By RagingAsian, with 28 replies.
Last reply by RagingAsian, over 10 years ago:
Should they stay private or change them to public? I posted the scenario as well on my profile.
Turns
By sophiaking, with no replies.
in my game i have a computer player and the payer controlled by a person and i want them to take turn in attacks. I'm using this code to assign the attacks if (BattleStage.turn == 1) { System.out.println("turn " +BattleStage.turn); Attack(); } however I'm stuck on making the attack happen after each other and going on until someone dies
I Need Help With Some Random Spawning
By Mikeburdge, with 6 replies.
Last reply by LordLuhar, over 10 years ago:
Yeah put them in both, once in the world code, and once in the food code
How to get an object to push another object forward in the same direction?
By LaffyTaffy65, with 5 replies.
Last reply by danpost, over 10 years ago:
Like I said, that code was not going to be exactly what you needed. You will have to determine which way to move the ball and move it in the proper direction. Unfortunately, I am short on time at the moment and will probably be out for several hours.
2D arrays
By KiwiMC1482, with 15 replies.
Last reply by danpost, over 10 years ago:
First issue: the 'adjustToGrid' method was created to accommodate square grid-cells. You will need two separate fields, 'gridCellX' and 'gridCellY', instead of the one field, 'gridCellSize' for the dimensions (width and height) of one grid-cell. Second issue (maybe): if the size of your Background world is not at least (1050, 600), then you will have an issue. After removing the declaration of the field 'gridCellSize' and adding in 'gridCellX' and 'gridCellY', you will need to set the value of those fields in your 'createVariable' method. Then change the 'adjustToGrid' method to this:
589
590
591
592
593
594
595
X