It would only take one or two random choices to produce added effect.
Try this for the Dot constructor:
public Dot()
{
setImage(new GreenfootImage(15, 15));
getImage().drawRect(Greenfoot.getRandomNumber(2)==0?img.getWidth()-2:0, Greenfoot.getRandomNumber(2)==0?img.getHeight()-2:0, 1, 1);
}
Finally, in your world class 'makeDefault' method, add the following condition for the statements in the following block:
if (UserInfo.isStorageAvailable())
{
GreenfootImage ui = new GreenfootImage(UserInfo.getMyInfo().getUserImage());
ui.scale(100,100);
def2.drawImage(ui,getWidth()/2-50,getHeight()/2-50);
}
Also, instead of copying each pixel color from one image to the next, just use the GreenfootImage method 'drawImage'. For example you can change one of your MagnifyImage class 'magnifyImage' methods to:
public static GreenfootImage magnifyImage(GreenfootImage img)
{
GreenfootImage image = new GreenfootImage(img.getWidth()/2, img.getHeight()/2);
image.drawImage(img, -img.getWidth()/4, -img.getHeight()/4);
image.scale(img.getWidth(), img.getHeight());
return image;
}
and similar for the other one.
Change your MouseActor class act method to this:
public void act()
{
MouseInfo mouse = Greenfoot.getMouseInfo();
if (mouse == null) return;
setLocation(mouse.getX(), mouse.getY());
updateImage();
}
'getWorld' return a World object (not particularly a 'Space' object; though it could be one). That is what '(Space)' does. It makes it a 'Space' object. This is called 'typecasting' and it informs the system to look in the 'Space' class for any methods or fields referenced with the World object. Any methods or fields that are declared in the 'Space' class would not be found otherwise.
2013/9/6
Textured Cube
2013/9/5
Streching Dots
2013/9/5
Streching Dots
2013/9/5
Streching Dots
2013/9/4
Math Formulas
2013/9/2
Magnifying Glass
2013/9/2
Magnifying Glass
2013/9/2
Magnifying Glass
2013/8/27
tut-access-p1