CODE:
/**
* Write a description of class Picture1 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Picture1
{
private Triangle roof;
private Square wall;
private Square window;
private Circle sun;
public Picture1(){
}
public void makeVisible(){
wall = new Square();
wall.moveVertical(80);
wall.changeSize(100);
wall.makeVisible();
window = new Square();
window.changeColor("black");
window.moveHorizontal(20);
window.moveVertical(100);
window.makeVisible();
roof = new Triangle();
roof.changeSize(50, 140);
roof.moveHorizontal(60);
roof.moveVertical(70);
roof.makeVisible();
sun = new Circle();
sun.changeColor("yellow");
sun.moveHorizontal(180);
sun.moveVertical(-20);
sun.changeSize(60);
sun.makeVisible();
}
public void sunRise() {
sun.slowMoveVertical(-300);
}
public void sunSet() {
sun.slowMoveVertical(300);
}
}
RESULT:
No comments:
Post a Comment