HolidayCard() { tortoiseWindow = Tortoise.getBackgroundWindow(); tortoiseWindow.addMouseListener(this); Tortoise.show(); Tortoise.setSpeed(10); drawGreetingAndSing(); }
public static void main(String[] args) { Tortoise.show(); Tortoise.getBackgroundWindow().setBackground(Grays.Black); Tortoise.setPenWidth(20); Tortoise.setSpeed(10); for (int i = 55; i < 999999999; i++) { Tortoise.setPenColor(PenColors.getRandomColor()); length = length + 1; drawTriangle(); Tortoise.turn(1000000000 / 20000); } }
/** * Makes a cool shape fast <div><b>Example: </b> {@code tortoise.drawShape(6,PenColors.Reds.Red, * 50, 20)}</div> * * @param sides the number of sides * @param color a snazzy line color * @param length the bigger the better * @param width make a thick line - it's cool */ public static void drawShape(int sides, Color color, int length, int width) { Tortoise.show(); Tortoise.setSpeed(7); Tortoise.getBackgroundWindow().setBackground(PenColors.Yellows.Goldenrod); new Text("TKP Java - Make Some Shapes!") .setTopLeft(225, 50) .addTo(Tortoise.getBackgroundWindow()); for (int i = 0; i < sides; i++) { Tortoise.setPenColor(color); Tortoise.setPenWidth(width); Tortoise.move(length); Tortoise.turn(360 / sides); } VirtualProctor.setClassName("Grace Hopper's Class"); VirtualProctor.setName("Jean Bartik"); }
public static void drawTortoise() { Tortoise.show(); Tortoise.setSpeed(9); Tortoise.getBackgroundWindow().setBackground(PenColors.Greens.DarkSeaGreen); new Text("TKP Java - It's the Tortoise!") .setTopLeft(200, 75) .addTo(Tortoise.getBackgroundWindow()); Tortoise.setPenColor(PenColors.Greens.Green); Tortoise.setPenWidth(3); makeTortoiseBody(); Tortoise.setPenColor(PenColors.Browns.Brown); Tortoise.turn(-65); Tortoise.makeTortoiseLeg(); Tortoise.turn(90); Tortoise.move(150); Tortoise.turn(-90); Tortoise.makeTortoiseLeg(); }