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

danpost's Comments

Back to danpost's profile

@Super_Hippo, NVM my last post, it does not do what I thought it would.
@Super_Hippo, When setting an image for the class (by right clicking on the class in the class tree at the right of the scenario window and selecting 'Set image...', click on the image at the left and then at the bottom of the selection window click on the tool icon (gear), then select 'Create new image...' and select the size.
@Super_Hippo, if your images are stretching or having slices taken out of them, it is probably because you are re-scaling your images. Always start with an unscaled image and scale it immediately to the size you need. Let us say the image for one of your actors is in a file called "player.png". [code]// save a copy of original image in an instance object field private GreenfootImage image; // in the constructor of that object image = new GreenfootImage(getImage()); // when changing the scale of the image public void scaleImage(double zoom) { GreenfootImage img = new GreenfootImage(image); img.scale((int)(zoom*img.getWidth()), (int)(zoom*img.getHeight())); setImage(img); }[/code]If scaling the image once when the object is being created, just move the code from the scaleImage method to the constructor, supplying the absolute zoom value needed.
@Super_Hippo, yeah, I forgot last time. It is now published.
@askgriff, I've noticed that this is common behaviour for Bot scenarios on the site. I do not know if it acts any different when downloaded (have not tried).
Easy fix. Just do not let the paddle get closer than half a paddle width from the side edges.
Success. Now shows on site.
Reflecting the image horizontally or vertically can be accomplished by use of the GreenfootImage methods 'mirrorHorizontally' and 'mirrorVertically'.
Don't be sorry. Impossible is not good, but challenging is, well ... great!