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

2019/6/28

whats wrong with my code?

Coltz Coltz

2019/6/28

#
import greenfoot.*;

/**
 * Write a description of class BlueDot here.
 * 
 * @author (your name) 
 * @version (a version number or a date)
 */
public class BlueDot extends Timer
{
    /**
     * Act - do whatever the BlueDot wants to do. This method is called whenever
     * the 'Act' or 'Run' button gets pressed in the environment.
     */
    public void act() 
    {
        Move();
        Timer();
    }    
    
    public void Move()
    {
        move(10);
    }
    
    public void Timer()
    {
        if(getX() == 599) 
        {
            Greenfoot.setWorld(new Test2());
        }
    }
}
You need to login to post a reply.