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
Scoring
By lexboy112333, with 5 replies.
Last reply by lexboy112333, almost 10 years ago:
Thank you. It helped me a lot.
Set certain image when an actor is not moving
By God, with 1 reply.
Replied to by danpost, almost 10 years ago:
You can change 'if' to 'else if' on line 15 and just use 'else' on line 20 (remove the following 'if' statements and just execute the 'setImage' command.
Editor Problems
By Toly, with 1 reply.
Replied to by danpost, almost 10 years ago:
Toly wrote...
For some reason when I put in "if (atWorldEdge())," it tells me that it can't find a symbol. Anybody know what to do?
Maybe you got the name of the method wrong. You should check the
Actor class API documentation
to verify this.
Method to other class?
By Weetis, with 1 reply.
Replied to by danpost, almost 10 years ago:
There are two possible errors that you could be getting on line 10 -- it would have helped if you explained what error message you were getting there. The first is the image filename -- image filenames usually end with 'png' or 'jpg' ( 'pjg' is not a normal image filename suffix ). The other is that a non-static method cannot be called from a static context. This means you need an object of the class to call the method on (you cannot call the method directly on the class name). Finally, there does not appear to be anything wrong with line 4 -- again without you being more specific, one can
A beginner for help
By beyond, with 1 reply.
Replied to by Boogabacon, almost 10 years ago:
What do you mean, do you want to add a raspberry? Marry me?
Make an object go away after a certain time
By Bassusour, with 7 replies.
Last reply by Super_Hippo, almost 10 years ago:
Bassusour wrote...
But how do I introduce an instance timer field?
<Code Omitted> And then, to increment it in the act-method: <Code Omitted>
Access Methods From an Different Actor
By Hydrowarrior, with 1 reply.
Replied to by danpost, almost 10 years ago:
I have yet to look at your video; but -- why would you edit the Mover class at all? I do not think it was intended for that. At any rate, I will look at the video to see what there is, EDIT: I do not think the method should be there, anyway -- it should probably be in your World subclass.
Make an actor rotate around another actor
By Cameronte10, with 5 replies.
Last reply by danpost, almost 10 years ago:
I would guess that the distance you are moving the enemy is not enough to change the angle by a full degree, so it moves back to where it started. Try increase the speed from 'move(1)' to something higher.
Book 2nd edition p. 9 concept
By keizerbob, with 5 replies.
Last reply by danpost, almost 10 years ago:
Okay. I see what you are saying. The margin text does say that the return type is part of the method signature; when it is actually not part of it. The main text along side it also implies that the return type is part of the method signature. It is given as part of the method description in the object menus provided by greenfoot; but, again is not actually part of the method signature. So, yes -- a correction in the book should be recommended.
Finishing touches
By starworld31, with 1 reply.
Replied to by danpost, almost 10 years ago:
You can look at my
Value Display Tutorial
to learn how to accomplish that.
How do I get this to bounce now? My teacher says I don't have the code in there for it and look in our notes, but I can't find it.
By tn13673, with 1 reply.
Replied to by danpost, almost 10 years ago:
Your 'bounce' method with line numbers follows: <Code Omitted>Line 11 is suspicious in that y
How am I supposed to get this to move? It just moves my itself right now, but I need to be able to control it.
By tn13673, with 1 reply.
Replied to by tn13673, almost 10 years ago:
Ignore, my teacher FINALLY got around to me.
Make an if-statement execute once
By Bassusour, with 2 replies.
Last reply by Bassusour, almost 10 years ago:
Thanks for the reply, it helped me :)
Rapidly Change Actor Image
By MrGalax1, with 2 replies.
Last reply by MrGalax1, almost 10 years ago:
Thank you very much, all working now :)
Instance variable across multiple classes
By Bassusour, with 7 replies.
Last reply by danpost, almost 10 years ago:
Bassusour wrote...
Thank you Super_Hippo :). However, this will lead me into a new question. How do i make the if-statement execute only once if true? Because it will spawn hundreds if the statement is true, and I only want it to spawn one instance
489
490
491
492
493
494
495
X