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
Istouching Method problem
By Ultr0x, with 3 replies.
Last reply by danpost, about 7 years ago:
You are calling
moveAround
from the constructor, which is executed only once before the created actor is placed into a world.
Zamoht wrote...
Are you calling moveAround() in your MoonLander/Rocket
act() method
?
This question should point you in the right direction to fix the issue.
how to create instance variables
By ericnjaramba, with 3 replies.
Last reply by danpost, about 7 years ago:
ericnjaramba wrote...
so i checked out that page about variables and ,my question is how to create a variable to keep track of wether the instance is keyboard controlled or moves randomly.
Well, it is either keyboard controlled or not (two possibilities). So, a
boolean
field in the class of the controlled actor seems to be what is needed. If there is a possibility that the controlled actor might change to be a different instance, then an
Actor
field in your
World
subclass could do the trick (or a static one in the class of the controlled actor).
How do I move an object random with a Smooth Mover?
By JamesArnus, with 1 reply.
Replied to by Zamoht, about 7 years ago:
A way to do this would be to randomly pick a direction. Then create a counter and make the object move in the random direction for <counter> act cycles. When the counter hits 0 you pick a new random direction and fill up the counter again.
app creating
By ebollinger@sonorahigh.net, with 5 replies.
Last reply by ErnieBoi, about 7 years ago:
davmac wrote...
ErnieBoi: please stop the over-the-top banter and restrict yourself to useful discussion. Thanks.
I WAS NOT OF THE MEANT TO OFFEND, I AM ERNIE WHO IS VERY SORRY
make my frog move
By the_potato99, with 1 reply.
Replied to by Super_Hippo, about 7 years ago:
Show what you have tried. Make sure you don't only turn the frog in one direction all the time.
Arduino
By Alexlife2002003, with no replies.
ino.sendData so that command i use to send data to arduino but how do i tell arduino to stop?
How do I spawn objects at random locations without risking that they spawn into each other?
By DML, with 1 reply.
Replied to by danpost, about 7 years ago:
DML wrote...
<< Code Omitted >> In lines 3-12, I defined some stuff that I need for the if-expressions that come later, but unfortunately, I can´t use getX or getY as the objects haven´t been added to the world yet. Adding the content of lines 3-12 into the if-expression would be too late because I need schatzX, schatzY, wandX and wandY for starting the if-expressions in the first place. Do you have any ideas how to fix this problem?
If this is a grid world (cell size not pixel-sized), then you could just make use of the
getObjectsAt
method as you add the actors into the world.
I need to communicate two clases
By SuperAmigo300, with 4 replies.
Last reply by danpost, about 7 years ago:
SuperAmigo300 wrote...
The codes are above.
You gave your world class codes twice and omitted your Boss class codes.
Gravitation-Simulator
By YuEmAydin, with 2 replies.
Last reply by YuEmAydin, about 7 years ago:
God damn... Thanks for the answer it was very helpful.
A question about snapping an object to another object
By Monserus, with 1 reply.
Replied to by danpost, about 7 years ago:
Monserus wrote...
Right now you're able to drag a ship to the field (the tiles where you play on). The problem is, that you're also able to put a ship between multiple tiles (e.g. putting a 2-tile ship in the middle of 4 tiles, which makes it 4 tiles large). A solution to this would be to make ships automatically snap to the tiles where their (mostly) located at. I wanted to know if thats even possible and if so, a short explanation would be really nice.
I will try to explain as best I can. First, let's define a ship of length 2 or 4 to be an even ship and one of length 3 or 5 to b
I have a problem!... pls help me(infinity loop)
By Felix123, with 7 replies.
Last reply by Felix123, about 7 years ago:
OK thx
How do I interrupt a loop after a certain amount of actors have appeared?
By DML, with 2 replies.
Last reply by DML, about 7 years ago:
Thank you :) Now it works.
Wie unterbreche ich eine Schleife, nachdem eine bestimmte Anzahl Actors vertreten ist?
By DML, with 2 replies.
Last reply by DML, about 7 years ago:
Danke :) Jetzt funktioniert es.
Do not spawn bullet
By greenfootUser343, with 2 replies.
Last reply by greenfootUser343, about 7 years ago:
Thank you Dan, that worked perfectly.
Bee production
By Phoenix36, with 3 replies.
Last reply by Super_Hippo, about 7 years ago:
Yes, the beeTimer can be read as "how many turns before the next bee should be placed into the world". At the beginning, it is set to 400 for the "do nothing" part and then it is used as the random time between.
229
230
231
232
233
234
235
X