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
need help with inserting multiple images using arrays
By stantwice, with 1 reply.
Replied to by danpost, over 7 years ago:
stantwice wrote...
i haven't started the code but the idea is that a random object will appear on my screen and the user will have to input the "name" of the object in order to get rid of it. how do i create an array list for the images?
I would think your list of images would be of a fixed length for any single run of the scenario (meaning you could change it between compilations). Therefore an array (as opposed to an
ArrayList
) would suffice. Also, you can probably kill two birds with one stone by using an array of
String
type objects instead of
GreenfootImage
o
error in terminal saying n must be positive
By Erasedsword, with 4 replies.
Last reply by danpost, over 7 years ago:
Line 10 is backward.
Continuous counter...
By KARLLLL, with 1 reply.
Replied to by danpost, over 7 years ago:
KARLLLL wrote...
I want my counter on my first world to continue its counting to the second world without the counter restarting to zero..... how do I do that?
Just set the counter in the second world equal to the counter in the first. For additional help, you will need to provide all codes related to the counter as well as the code about which the changing of worlds occurs.
Need help: Passing variable from world class to actor class
By Sploit, with 2 replies.
Last reply by Sploit, over 7 years ago:
First of all, thank you for the quick response :) Your tip helped me to reinvent the code a little bit with the help of a cooldown in the beginning - now it works, because the boolean is being initialised after the cooldown was count down. Here's the code:
Bei Hindernissen stoppen
By Meier1001, with 2 replies.
Last reply by Meier1001, over 7 years ago:
Ich habe es schon selbst geschafft, Danke :D
How to make bullet collision detection?
By MrMinestrone, with 5 replies.
Last reply by MrMinestrone, over 7 years ago:
danpost wrote...
MrMinestrone wrote...
How do you do that?
Use the
removeTouching
method. Put it first as '
this
' actor needs to still be in the world for that method to work.
Ok, thanks
reference for X and Y position
By duster2801, with 3 replies.
Last reply by danpost, over 7 years ago:
duster2801 wrote...
Thank you very much my friend, i now realise the mistake i made thank you!
You should probably share so others who come across this discussion do not make the same mistake.
Weird Inconsistent Issue with Greenfoot.isKeyDown()
By knackchaos, with 1 reply.
Replied to by danpost, over 7 years ago:
Since your given code was to only provide the structure, I will ignore the fact that (a) the method name indicates left movement; (b) the "d" key being pressed is usually used for moving right; and (c) the rotation faces the actor to move down -- quite confusing, if you ask me. At any rate, you might check to see if the issue is related to a particular OS. Or, maybe its possible that key contacts are bad on some keyboards. Well, that is about all I can immediately come up with. Best of results.
How to I make background music?
By Poseidon420, with 16 replies.
Last reply by TheGoldenProof, over 7 years ago:
no, but I think im going to leave it how it is. Theres currently more I can do with it the way it is, like make a song queue.
How do i fix this?
By t.jongsma, with 2 replies.
Last reply by t.jongsma, over 7 years ago:
this code was to complicated for sure. i fixed it with a much more simple code<Code Omitted>
Need some help with overlapping actors
By renniemm, with 2 replies.
Last reply by renniemm, over 7 years ago:
It works now- thank you!
Best way to coordinate a bullet hell?
By TheGoldenProof, with 3 replies.
Last reply by Super_Hippo, over 7 years ago:
My game doesn't have that much code. Ok, it isn't really complex, but the idea is that you don't make it more messy than it has to be. For example I only have one class for all enemies (except the boss). I only pass a parameter to decide which one should be added (general type, what it fires and how fast it fires). So you don't need a crazy copy&paste festival for every different enemy/bullet you want to add.
Image Resizing Issue in Greenfoot
By Biscuits1, with 2 replies.
Last reply by Super_Hippo, over 7 years ago:
The image in the "actor box" is only the default image. Inside the Crab class, there is code which sets the crab images to the crab (it alternates between two to make it look like moving). You can find the code by searching for "setImage" inside the class. Changing the default image doesn't change the code. It only changes the image if the image isn't set in the class code.
How do i fix this?
By t.jongsma, with 2 replies.
Last reply by Super_Hippo, over 7 years ago:
Try to swap lines 11 and 12. And move line 10 into the constructor. No need to execute it every act cycle: <Code Omitted>
My Scenario is not starting
By Xanxus, with 4 replies.
Last reply by Xanxus, over 7 years ago:
I dont know why this error message shows up
200
201
202
203
204
205
206
X