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
Want to spawn specific actor based off value of array
By MichaelMac, with 3 replies.
Last reply by danpost, over 9 years ago:
Since no more information was given, I could only speculate that the actors each represent a dice with a different value. Then, the answer to 'is there a better way' would be "yes" (definitely better from a design perspective; but faster -- as far as coding time, probably; as far as execution time, questionable).
Show score at the end
By JokeNotFound, with 6 replies.
Last reply by JokeNotFound, over 9 years ago:
Thank you very much, it worked!!
How to properly export a project...
By PJaymz, with 3 replies.
Last reply by danpost, over 9 years ago:
You could put a copy of the executable file (created by locally sharing to make an application) in the project folder and upload it here with the source code checkbox checked. Then they can download it from the site, extract the files by unzipping the downloaded folder and take the executable from inside it.
Creating an Ammo Counter
By ThanksGreenfoot, with 6 replies.
Last reply by Super_Hippo, over 9 years ago:
Show the whole code again (and use code tags please). Did you create an act method?
Logic with Classes
By gurgi414, with 3 replies.
Last reply by Nosson1459, over 9 years ago:
You can't use the equal operator for classes if that 's what you're asking. You should probably use 'instanceof'.
make sound when turning a certain amount?
By Mjosue, with 4 replies.
Last reply by Nosson1459, over 9 years ago:
Mjosue wrote...
The professor wanta the sound to play whenever the crab turna 18degrees or more.
So what's your problem? The code given by Hippo will find the amount of degrees to turn and if it's greater than 18 or less than -18 (for turning in the other direction) it will play a sound.
how to i make a lobster eat every other crab?
By Mjosue, with 5 replies.
Last reply by Mjosue, over 9 years ago:
Illtry it once i am home.
How do I make worms turn as follows?
By Mjosue, with 7 replies.
Last reply by Mjosue, over 9 years ago:
Ill try it as soon as i get home. Thanks
Help Making An Actor Follow A Mouse When Mouse Is Pressing it
By MichaelMac, with 1 reply.
Replied to by Super_Hippo, over 9 years ago:
What exactly do you want? - mouse pressed on actor → actor is set to mouse location as long as mouse is pressed/dragged = something like drag & drop - mouse pressed on actor → actor is "selected" → mouse moves around, actor is set to mouse location until the next mouse click will unselect it = similar to above - mouse pressed on actor → actor is "selected" → mouse click (right mouse button?) tells the actor where to move (strategy games) - something else? From your text, I would guess it is option number 1, but I am not really sure. If it is, you could check for the mouse click on the a
How to add objects only if a button is pressed
By ObliviaOng, with 10 replies.
Last reply by ObliviaOng, over 9 years ago:
ahhh no wonder, whoops i forgot to type that down, i just ran the program and it works, thank you so much for your help! :D
Working with files
By mitrolex, with 5 replies.
Last reply by mitrolex, over 9 years ago:
Thanks danpost, it worked.
Automatically changing & insert objects after.
By OKNEM, with 17 replies.
Last reply by Super_Hippo, over 9 years ago:
You can't use timers like that in a method which is only called from the constructor and not from the act-method. It is only executed once. Another thing is that the Intro and Rules you add is not the same as the one you save in the 'intro' and 'rules' variables. Try out this:
Bounce off walls at opposite angle
By 101929ha, with 2 replies.
Last reply by 101929ha, over 9 years ago:
YAY! It works. Thanks danpost!
How can I make the wombat eat all the leaves on its own
By Lollava, with 1 reply.
Replied to by Nosson1459, over 9 years ago:
you can put in a random number and instead of just turning left you can turn right and left resulting in the wombat moving all over instead of just the edge
How can the second actor to follow the primary actor
By H3ater, with 1 reply.
Replied to by Nosson1459, over 9 years ago:
That's a very good question, because if you're following someone then your turns aren't random if your turns are random then you might end up going in a different direction then whatever it is you are following. You can have one actor follow another but I don't know what you mean by "follow the Bee with random turns".
385
386
387
388
389
390
391
X