public static void main(String[] args) { Tortoise.setSpeed(10); Tortoise.getBackgroundWindow().setBackground(PenColors.Yellows.Goldenrod); int branchLength = 65; Tortoise.setX(175); Tortoise.setY(350); drawBranch(branchLength); drawBranch(branchLength - 1); Tortoise.setX(450); Tortoise.setY(350); drawBranch(branchLength); drawBranch(branchLength - 1); }
/* 2. When the mouse is clicked draw a tree at that position. */ public void mouseClicked(MouseEvent mouseEvent) { System.out.println("mouse clicked!"); int mouseX = mouseEvent.getX(); int mouseY = mouseEvent.getY(); // Set the X position of the Tortoise to the X position of the mouse Tortoise.setX(mouseX); drawTree(); }
public static void main(String[] args) { Tortoise.setSpeed(10); Tortoise.setX(200); int height = 60; // drawhousewithFlatRoof(height); drawhousewithSlantyRoof(140); drawhousewithFlatRoof(110); // drawhousewithStairRoof(120); drawhousewithPointRoof(130); }