@hkrhassleholm,
(1) radius is actually the size of the star (in pixels). It is not really being used as a radius, but as a diameter here. The next line creates an image with that size and two lines later the circle (oval) drawn on the image also uses it as the diameter of the star.
(2) this is the part of the code that moves the star. For some reason (or for no reason) this code is adding speed to the x location twice; once in the 'x =...' statement and once in the 'setlocation(...' statement. That just makes each star move twice its speed. The last statement will 'wrap' the star around the world: if on left edge, set the next x to at the right edge.
(3) x and y, here, will be used to place a star in the world. The 800 (which is the width of the world) and the 600 (which is the height of the world) ensure that what is returned will be somewhere in the world. Whatever the number (800, 600, 2), it is the number of possible returns, starting at zero and ending at one less than that number.
I think you need to work more on this one before moving on to something else. The seals are going 'under' the water and 'sneak-attacking' the seal for lunch!
@hkrhasleholm, Greenfoot has as command that will start the scenario from the world constructor. And resetting does work, but again starts the scenario and it is very hard (at least in this scenario) to tell that it actually was reset.
I saw that the code was available for download.
In the act method of the Bullet class, do the following
// before the first 'if', add
boolean removeMe = false;
// in each Zombie 'if' block, add
removeMe = true;
// change the last 'if' to
if (removeMe || atWorldEdge())
canSee better not be a void; it must return a boolean; and if it does, the return must be true or false. Either you have your terminology wrong or your code is wrong. That is, either you are not correct in calling the canSee method a void when, in fact, it is a boolean method; OR, you coded your canSee method as a void when it should be a boolean method. If you show the code you have for the act method, I believe I could find what is amiss (that is if your canSee method is coded properly).
2012/10/30
Lab 4 – Parallax scrolling
2012/10/29
food chain
2012/10/29
food chain
2012/10/29
star scrolling
2012/10/29
BreakingDead
2012/10/29
BreakingDead
2012/10/29
BreakingDead
2012/10/28
BreakingDead
2012/10/27
Star_Trek