This site requires JavaScript, please enable it in your browser!
Greenfoot back

What is happening right now?

Yehuda

reply to Automatic Javascript conversion of Scenarios

By Yehuda - about 7 hours ago
The image of an Actor in one of my scenarios doesn't show. In Stopwatch the image displaying the elapsed time is not there, it's supposed to be under the reset button to the right of the stop button. (The scenario can be seen in it's working state when not using this Javascript version.) It seems that using text with GreenfootImages doesn't work, when I went to this scenario I saw that there's no text either.
Yehuda

reply to Remove a class and use an other class to do her job

By Yehuda - about 7 hours ago
Problem 1: For the Paddle to be removed you need the ball to be touching the paddle when s == 48. If you want to remove all the paddles from the world (which will remove the one that's there), then you can do the following: <Code Omitted> Problem 2: I can't help with what's happening with the Paddle2 with the code you gave, you need to show the full Paddle2 class code.
SebiRaul

reply to Start screen not working

By SebiRaul - about 8 hours ago
Aah, I completely forgot about the act method. Thank you so much :D.
danpost

reply to Why won't my scenario run?

By danpost - about 10 hours ago
Fact 1: an actor must be created prior to it being placed into a world Fact 2: the constructor of an object is executed at the time the object is created This being said, 'getWorld', when used in the constructor of an Actor subclass, must return a 'null' value. Line 15 of the Score class constructor sets 'null' as the value of the 'world' variable. Then, line 16 and 17 tries to call the 'getP!score' and 'getP2score' methods on that 'null' value. Hence, the 'NullPointerException' error you were getting. You could make use of the 'addedToWorld(World) method of the Actor class, which is called when the actor IS placed into a world; but, since you know the score will be zero to zero when the Score object is created, why not just replace lines 15 through 18 with this: <Code Omitted>
danpost

reply to Remove an actor from the World class

By danpost - about 13 hours ago
There is no code to add a ball into the world (nor created). So 'myBall' is never assigned any Ball object that can be removed.