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
Moving player from world to world help
By Salcrainia, with 13 replies.
Last reply by Salcrainia, over 11 years ago:
Yes all of that has been removed and kept within the different levels code, thanks for the help although I did need to add the objects for score and lives so that they would carry over.
Maze scenario
By K@pil, with 1 reply.
Replied to by Super_Hippo, over 11 years ago:
You can create a new class and add it to the world when the ball reaches the finishing block. This object should have an image with the wanted string on it.
I just want to stop the car while the traffic light is Yellow, And should move the car when the traffic light is Green.
By VIvek_Rajagopal, with 2 replies.
Last reply by danpost, over 11 years ago:
(1) Line 2 can be removed as no lists are being referenced in the class; (2) Line 3 can be removed because the java.lang.Object class is automatically available to all classes; (3) Line 19 declares a variable that is not later used within the method; it can be removed without changing the way the method currently executes (I am not saying to actually remove it, here); (4) Line 23 compares a new object to a previously created object; they are two distinct objects; that is, they are not the same object (however similar they may be) and the comparison will show that they are not the same obje
How to getImage() from a location by using getIntersectingObjects() and compare a default image ?
By VIvek_Rajagopal, with 3 replies.
Last reply by VIvek_Rajagopal, over 11 years ago:
I have created like this, <Code Omitted>Being honest, I don't know how to understand things from the API documentation. Please tell me a way to stop and move the car according to the detected image.
I mant to animate a frog jumping
By richyd012, with no replies.
so ive already got the animation of the frog moving perfectly just how i want it but i cant seem to stop the whole world from moving when it animates. when i use timers or counters the animations just don't works as well, like the frog does come bak to its original position when the key is released <Code Omitted>
windows 8.1 java 8 +
By actinium, with 5 replies.
Last reply by danpost, over 11 years ago:
I do not know if it will make any difference or if yours is set or not; but, if the checkbox at the top of your Java security settings tab that allows java content in your browser is not checked, try checking it.
How to spawn an object at xy location on mousehover?
By YosuaZakaria, with 3 replies.
Last reply by YosuaZakaria, over 11 years ago:
It works, thanks a lot danpost :) o7
is there anny easy way to find the sorce file of a greenfootImage?
By fejfo, with 7 replies.
Last reply by danpost, over 11 years ago:
Was this just a curiosity question, or was there a specific reason for asking it? and if there was, why? that is, what is it you were hoping to accomplish once the acquired filepath/name was acquired?
How can I detect the upcoming object infront of my actor ?
By VivekRajagopal, with 1 reply.
Replied to by Super_Hippo, over 11 years ago:
Since your issues are connected to each other, you don't have to open two discussion threads for that. If your crossroad has exactly horizontal and vertical streets, you can check for the lines without having the lines as an object. If you want to do it as an object, you can check for collision with the line like you do with other cars (check the other discussion thread). If not, it will be something like this: if, after moving the additional dx, the x-position of the car which comes from the left side is greater than the x-position of the left line, or the x-position of the car which comes
Cars as object and they should stop from collision and stop in the traffic light also.
By VivekRajagopal, with 1 reply.
Replied to by Super_Hippo, over 11 years ago:
How I do it in my
Traffic Simulation 2
simulation, is that I simply move the car more than it actually drives (+dx) and check for collision. So I can see if there is another car in front of it and if yes, it should brake. Then move back the distance that it moved "too much" (-dx).
get X/Y of another class?
By h123n, with 1 reply.
Replied to by danpost, over 11 years ago:
This
shows what you can do.
Can anyone tell me how to maek my enemy shoot?
By jocallaghan97, with 3 replies.
Last reply by danpost, over 11 years ago:
You will need three values -- one for the minimum delay (measured in act cycles) between shots and another for the maximum delay. The third value will be for the timer itself and will be an instance field in the class (the other two values can also be made fields if desired as follows:
Help-barriers
By Leenza, with 8 replies.
Last reply by danpost, over 11 years ago:
You cannot compare literal strings with field values like as in lines 5 and 9. You will always get a false result in the comparison as the literal String object is not the same object as the one referenced by the field. You need to compare the contents of the String objects, not the objects themselves. This is done by use of the 'equals' method. For example, line 5 should be: <Code Omitted>
How can I dynamically change the size of the world? (Only once, however)
By decadence18, with 7 replies.
Last reply by decadence18, over 11 years ago:
@Danpost, I managed to do it using a globally-defined variable in a world previous to the one in which I needed the variable.
How can I dynamically add a certain number of "variables"?
By decadence18, with 10 replies.
Last reply by decadence18, over 11 years ago:
That might work too. I have two classes that need to use this painting technique; I may try both to see which one would work better for this purpose.
582
583
584
585
586
587
588
X