This site requires JavaScript, please enable it in your browser!
Greenfoot back
Game/maniac
Game/maniac wrote ...

2013/11/10

Greenfoot Bug?

Game/maniac Game/maniac

2013/11/10

#
import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
import java.awt.*;

/**
 * Write a description of class MyName here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class MyName extends SmoothMover
{
    public MyName() {
        setImage(new GreenfootImage("Game/maniac", 17, Color.white, new Color(0, 0, 0, 0)));
    }
    
    public void act() {
        if(getY() < getWorld().getHeight()/2+117) {
            setLocation(getX(), getY()+1);
        } else if(getY() > getWorld().getHeight()/2+117) {
            setLocation(getX(), getY()-1);
        }
    }
}
for some reason the image 'stains' the background as it moves.
Gevater_Tod4711 Gevater_Tod4711

2013/11/10

#
Are you shure that this code changes the backgroundimage? Maybe there just are more than one of this objects so that it seams that it 'stains' the background.
Game/maniac Game/maniac

2013/11/10

#
I feel so stupid now, thanks for the help :);
You need to login to post a reply.