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
Constant Crashing
By Ehhhh, with 3 replies.
Last reply by Bluefootisbetter, about 7 years ago:
lmao got em
Greenfoot Terminal won't open. Tried previous solutions to no avail
By SweetCaroline36, with 2 replies.
Last reply by danpost, about 7 years ago:
If on a Windows system, try hovering over task bar icon; then, move to mini-image and right click to select "Maximize".
How to find the index of the nth occurence of a given phrase in a string
By Zweeg, with 1 reply.
Replied to by danpost, about 7 years ago:
There is another, actually 4,
indexOf
methods in the
String
class. Make use of stringName.indexOf("phrase", position) where
position
is where in
stringName
you want the search to start.
VERY URGENT
By ebollinger@sonorahigh.net, with 1 reply.
Replied to by danpost, about 7 years ago:
ebollinger@sonorahigh.net wrote...
I cant find a way to know how to shoot a bullet in the direction of my mouse click.
It is quite straight-forward: <Code Omitted>
Score counter broken on level two, works fine on level one
By jonah420123, with 33 replies.
Last reply by danpost, about 7 years ago:
Take a look at your
checkDeath
method. You got through all rotation to do pretty much the same thing as the following
if
with
getOneIntersectingObject
-- quite redundant. Remove lines 59 to 98. Next, notice that you ask about
death
right after it could possibly be changed. Better coding would be to just do what needs done when it is changed (as by copy/pasting lines 106 thru 111 to be inserted at line 103. In fact, that way, you would not need either variable
death
or
redbike
/
bluebike
.
Need help please
By Saveseals2, with no replies.
<Code Omitted>
How to use intersects() method
By BackFlip125, with 4 replies.
Last reply by danpost, about 7 years ago:
BackFlip125 wrote...
yes it should repeat for each time the car intersects the oil slick. sorry if that was misleading
Maybe a misunderstanding here. I did not mean each time the car intersects (hits, or first comes in contact) with an oil slick. I meant the continuous intersecting of the same hit. For one car/oil slick collision, there will be some time of interaction. This will most undoubtedly take a number of act cycles. I was asking if these things that you want done, we to be executed once per collision (regardless of how long the intersecting lasts) or executed once for each
A quick question
By cesarinstalled, with 1 reply.
Replied to by danpost, about 7 years ago:
cesarinstalled wrote...
Hello. I was recently asked the question on why does move go next to Greenfoot.delay and not under it. I know it acts differently but i do not know the proper terminology to explain.
Please show an example of what you are referring to (definitely not explained well).
stuck on initializing...?
By nolttr21, with no replies.
I created a
project
, and when I uploaded it to this site it shows a black screen with white text saying initializing... Is there anything I can do to solve this problem?
(Urgent) How do I do a health bar
By SuperAmigo300, with 13 replies.
Last reply by danpost, about 7 years ago:
ebollinger@sonorahigh.net wrote...
Or you can make difrent health bars
If you mean make multiple health bar classes -- not an idea worth considering. Keep it simple. Have one class to display a bar. Create how ever many bars you need from that one class.
how to creat a scenario
By nora_grey, with 1 reply.
Replied to by danpost, about 7 years ago:
Download/install the Greenfoot application. Run it and select 'Scenario>New Java Scenario...'; give it a name and click the '
Create
' button and, !voila!, you have created a scenario. Granted, it does not do much (rather, anything); but, you will be on your way. Just add some code (at minimum).
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
228
229
230
231
232
233
234
X