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
Incompatible Types
By Cirion, with 1 reply.
Replied to by danpost, almost 8 years ago:
The method call on the right side of line 5 does not return any value (it is a 'void' method). So, you are not assigning anything to the 'run4' variable on the left. Set the variable to a copy of 'run1' using 'new GreenfootImage(run1)', then mirror the new image on the next line.
Object should spawn randomly
By MetinPlays, with 17 replies.
Last reply by danpost, almost 8 years ago:
일리ㅏ스 wrote...
danpost wrote...
You probably just need one actor in the world from the following class: < Code Omitted > The only behavior given in this class is what you had indicated was needed. Any other behavior will have to be added as needed. And, of course, the class name can be modified as desired.
You are checking for 60 act iterations, not 60 seconds.
Yes, I am checking for 60 act iterations -- which is about 1 second -- not 60:
MetinPlays wrote...
I want one object of my game to spawn randomly on the field an remove
after 1 second
and spawn again somewhere ran
How to make Greenfoot Left click when "C" is pressed
By Rexsan, with 2 replies.
Last reply by danpost, almost 8 years ago:
More than where to put 'Greenfoot.mouseClicked(this)', wihich should be ANDed, using '&&", at line 21, is what to use in the 'delay' parameter, which should not be less than one (or rather should not be used at all and a timer should be introduced).
Static variable not resetting
By Diactaeon, with 3 replies.
Last reply by xbLank, almost 8 years ago:
danpost wrote...
Calling 'Greenfoot.stop()' does not in any way cause a branch in program execution. That is, it will not prevent the rest of the method from executing. Only a 'return' statement or a run-time error can do that. The 'stop' method only sets a flag that will be checked later (between act steps, I believe) to pause the scenario.
That is correct. I did not know that. But I agree with danpost. Check if you are using it in your act method. I don't think you are.
Graphics and HTML5 support
By Zamoht, with no replies.
Now that Java AWT isn't supported, does that mean we won't be able to render stuff using things like anti aliasing? How is the drawing even translated to HTML5 at this point, and will more rendering options be available in the future?
Need help with Location of an object
By MetinPlays, with 3 replies.
Last reply by MetinPlays, almost 8 years ago:
Ok I've made it, thanks a lot!
Keeping track of Multiple Actors in a Class
By xbLank, with 4 replies.
Last reply by xbLank, almost 8 years ago:
Great way to look at it. Merry Christmas.
Adding my old move method but with new variables?
By Recorsi, with 5 replies.
Last reply by danpost, almost 8 years ago:
In the overriding method add the following line: <Code Omitted>
help!
By agray11202, with 4 replies.
Last reply by Super_Hippo, almost 8 years ago:
Either in the act method or a method which you call from the act method. There is nothing wrong about just putting it into the act method.
help!
By agray11202, with 2 replies.
Last reply by danpost, almost 8 years ago:
agray11202 wrote...
is it possible to make an if statement when a certain object is touching a certain color???
Why not this: <Code Omitted>where 'touchingColor' returns a boolean value indicating the touching state. The parameters would be any information the method might need in order to make the determination on that state. So, the answer to your question is --- Yes. I really do not want to appear so blunt, vague or general about it; but usually, help can only be given in proportion to the amount of information provided.
Want to make my enemies shoot
By Kordus, with 2 replies.
Last reply by danpost, almost 8 years ago:
If you were to put a comment on the 'canSee' method, it should read: <Code Omitted>The center being the location gotten from '(getX(), getY())'. So, the 'shootPlayer' method will need to use something else to determine when to fire. It will also need another condition to limit how often a projectile is fired when the player is in range. This can be a random chance thing or a regular or randomized timer.
Background music
By Kordus, with 6 replies.
Last reply by Kordus, almost 8 years ago:
Thankyou Super_Hippo and nolttr21
How to make this rectangle move
By jacquelinereilly, with 24 replies.
Last reply by jacquelinereilly, almost 8 years ago:
Got it working -thank you!
Impassible Walls
By jett, with 4 replies.
Last reply by danpost, almost 8 years ago:
jett wrote...
danpost wrote...
What is the code to the act method?
<Code Omitted>
This is before your moving things around. What I see here is that you move and then check for collision. But the 'originalX' and 'originalY' are acquired after moving; so, it is like -- good luck moving back. That is, they acquire the new coordinates of the actor -- not the original ones.. Now, with the new code, I see you checking collision before moving. How is this to work if the actor is
Actor doesnt act() after creation
By MuellerO, with 1 reply.
Replied to by danpost, almost 8 years ago:
I would, first off, think that line 4 would show an error and the project would therefore not compile. Also, line 15 looks like it may produce some errors during specific circumstances. It also looks like a single sheep could produce an abundance of new sheep when eating grass. Insufficient code was given to determine why you are getting your current behavior. Please show the code for the entire Sheep class.
300
301
302
303
304
305
306
X