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
Endscreen
By Malmi, with 2 replies.
Last reply by Malmi, over 9 years ago:
I will try it thx ;D(It worked)
Help!
By RaymondSun, with 2 replies.
Last reply by danpost, over 9 years ago:
Super_Hippo wrote...
Change the if's in lines 22 and 26 in the moneybad class to 'else if'. It shouldn't just stop but show you an error message (NullPointer Exception).
Actually, it would be an IllegalStateException. When moneybag touches thief (line 22) and moneybag is removed (line 24), the next thing attempted is 'getY()' (line 26) which cannot be 'null', but will cause an issue if the actor is not in the world (the illegal state of the actor when calling that method).
How do I change the Layer?
By 11870, with 7 replies.
Last reply by 11870, over 9 years ago:
Thanks! I got it to work.
HELP! Counter Problems
By salvo, with 14 replies.
Last reply by danpost, over 9 years ago:
Super_Hippo wrote...
and move line 19 to line 23.
This was said earlier about the class code. Actually, moving it down one line is enough. It is line 29 in the most recent code post that must be moved down (one line is sufficient).
How do you add objects that come onto the screen later in a moving background?
By Hamza_Abdulla03, with 4 replies.
Last reply by Super_Hippo, over 9 years ago:
Please use code tags, so you can say in which line you get your error. Change <Code Omitted>to <Code Omitted>
How do I move my enemies?
By 11870, with 4 replies.
Last reply by 11870, over 9 years ago:
Thanks! That worked!
Accessing Method in TestCase
By rockon411, with 5 replies.
Last reply by rockon411, over 9 years ago:
Thanks guys!
Cartesian Coordinates?
By Wasupmacuz, with 10 replies.
Last reply by Wasupmacuz, over 9 years ago:
danpost wrote...
Wasupmacuz wrote...
I'm still interested :P I come across this problem a lot in my scenarios. However, I already re-coded the class yesterday :/
Well, you will need both the following classes to extend everything from. The TransWorld class (for translating of world coordinates):
HealthBar creation
By ironphoenix20, with 31 replies.
Last reply by danpost, over 9 years ago:
ironphoenix20 wrote...
you mean i should take in a parameter for damage in the update method and change the values and image accordingly?
That is about right (if not spot on). The parameter does not necessarily have to be for damage only -- it can also be for healing as well. Using a method signature of 'public void adjustHealth(int amount)', a negative parameter value would be for damage and a positive one would be for healing. Just adjust the health value and call a private method to update the image.
java.lang.Class<?> cls arguments
By timothytitus, with 10 replies.
Last reply by Nosson1459, over 9 years ago:
danpost wrote...
You are assuming that the number of intersectors and their types are not important -- that as long as one is touching, then the check is satisfied. That, however, was not specified and may not be the case.
All of it is right there, and shows that is the case.
timothytitus wrote...
...for these arguments, to be able to put multiple classes in. ...maybe I want my player to detect collision with a couple specific classes but those classes aren't subclasses of another class. Therefore, I can't just put one class for the argument, I can't put "null" either coz there's som
How can I create an enemy who is moving random and is checking for walls.
By Malmi, with 3 replies.
Last reply by danpost, over 9 years ago:
Malmi wrote...
I want them to move to all four directions ;D
I was thinking it might be easier to have a single direction field whose valid values are 0 through 3: <Code Omitted>When multiplied by 90, you get the direction of movement. A simple method for movement might be: <Code Omitted>and a method to change direction: <Code Omitted>Then the move-chec
Accessing Actor Method from World
By rockon411, with 5 replies.
Last reply by danpost, over 9 years ago:
rockon411 wrote...
Thank you!
Hippo had a point about spending money that was not there. Better might be this: <Code Omitted>
Don`t use the Middlepoint of the Player while hitting the wall
By Malmi, with 4 replies.
Last reply by Malmi, over 9 years ago:
I got it now thx
Access Methods from World
By rockon411, with 2 replies.
Last reply by rockon411, over 9 years ago:
Thank you!
Shoot in every direction
By Malmi, with 10 replies.
Last reply by Malmi, over 9 years ago:
okay that works NICE ;D
373
374
375
376
377
378
379
X