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
Destructor
By moobe, with 25 replies.
Last reply by danpost, over 12 years ago:
moobe wrote...
what do you mean with<Code Omitted> Isn't it the same way I've written my program?
You know, maybe I changed it, and then changed it back. Sorry.
How to change the background if an actor hits the edge of the world?
By bbwf, with 23 replies.
Last reply by danpost, over 12 years ago:
Then you need to add and pass a value that tracks which world you are in, and use that value to determine which world to go to.
cannot open sound file?
By AnneMacaroni, with 2 replies.
Last reply by AnneMacaroni, over 12 years ago:
NVM, I got it :P
problems with my code again
By theuberjew, with 1 reply.
Replied to by danpost, over 12 years ago:
This statement:
if (enemyHit = true)
should be giving you an error message saying something like 'cannot find variable enemyHit'. To make it call the method, use
enemyHit
()
. At this point, you will probably get another message because you cannot assign a value to a method. This is a result of using an assignment operator '=' instead of the conditional equality operator '=='. A note on this: being the method 'enemyHit()' returns a boolean value, it is not neccessary to compare it the 'true'.
if(enemyHit())
does the same job. I did not look further into the c
Set a world
By moobe, with 7 replies.
Last reply by moobe, over 12 years ago:
Hmm, I think you haven't understood me: re-creation means repeating the level. I will think about this problem and tell you guys, when I've solved it...
Count help, Please anyone!
By Connman, with 1 reply.
Replied to by danpost, over 12 years ago:
The line
int textCount=0;
sets the value of a new local 'textCount' variable to zero. The next statement compares that same value to zero. Well, it was just set to zero; so, yeah, it is comparitively equal to zero. The next statement increments that value; so now it is equal to one. The following statement compares that value to one hundred. Well, no, it is absolutely equal to one, not one hundred. Therefore, the new Player1wins world will never activate. Upon exiting the method, all non-static variables that are local to the method are flagged for garbage collection. This is wha
Sprites Movements !!! NEED HELP IMMEDIATELY PLEASE :(
By SpritesKing, with 5 replies.
Last reply by SpritesKing, over 12 years ago:
btw i already fixed that problem thanks :)
fallUntilGround
By moobe, with 9 replies.
Last reply by moobe, over 12 years ago:
OK, it doesn't matter, it works fine since my third post. But it isn't a nice style ;)
Timer to stop game after 60 seconds or something
By danbyization, with 17 replies.
Last reply by danbyization, over 12 years ago:
No i didnt but now i have and it works fine thank you so much for helping me i really appreciate it
how to get acces of the World class with an actor class
By schoki7, with 1 reply.
Replied to by danpost, over 12 years ago:
To access a variable in your
sub-class of World
(not the World class, which is the super-class of the world where you placed the variable), You need to cast what is returned with 'getWorld()' to that which you named your sub-class of World. If your sub-class of world was named 'MyWorld', then: <Code Omitted>provided that the variable has public
Problem with deleting an object at a certain time
By zakariaonlyy, with 5 replies.
Last reply by zakariaonlyy, over 12 years ago:
It worked perfecty thank you Dan :) Actinium also thanks for your response mate
Repeating missile shot, delayed.
By Mindlezs, with 5 replies.
Last reply by Mindlezs, over 12 years ago:
Great, i get it. Thanks :D
Does anyone have a snake game?
By behappy2, with 3 replies.
Last reply by danpost, over 12 years ago:
I have several demos for snakes. Click on my picture icon (the fractal image) and on the lower right you will see my Collections. Go to the 'Demos by danpost' collection and check out the 'Snake Tracks Demo' specifically; as that one eats food to grow. I would also suggest looking at the others for different ways for the body segments to play 'follow the leader'.
Programming error
By drewleighton, with 1 reply.
Replied to by Duta, over 12 years ago:
If you get that error, then you've attempted to create a method that returns a value ...but you've never returned a value. For example: <Code Omitted> ^This would give an error, as you need to return a value. The method should be this: <Code Omitted> If you are creating a method with "void" return type, then it doesn't return a value, and so you do not need a return statement. You
can
put return statements in a method with "void" return type - this will
can somone tell me whats wrong with this code please.
By theuberjew, with 16 replies.
Last reply by danpost, over 12 years ago:
In order to work with List object, the List class must be imported into your class with <Code Omitted>However, this would be more to the point and not require importing java.util.List: <Code Omitted>Knowing where to go to find what methods are available is of the upmost importance. You do not neccessarily have to learn each method inside and out. Just knowing that there is a method that does a specific thing is enough, because then you just go back to the information on it and ut
889
890
891
892
893
894
895
X