canvas.clear(); var t1 = new Turtle(1); var t2 = new Turtle(1); var t3 = new Turtle(1); var t4 = new Turtle(1); t1.penColor(0,255,0); t2.penColor(0,0,255); t3.penColor(255,0,0); t4.penColor(0,255,255); t1.penWidth(5); t2.penWidth(5); t3.penWidth(5); t4.penWidth(5); function frame() { t4.penUp(); t4.forward(75); t4.left(90); t4.forward(30); t4.left (90); t4.penDown(); t4.forward(80); t4.left(90); t4.forward(170); t4.left(90); t4.forward(80); t4.left(90); t4.forward(170); } function fth() { t1.penDown(); t1.forward(30); t2.penUp(); t2.right (90); t2.forward (40); t3.penUp (); t3.right(90); t3.forward(80); t1.right (90); t1.forward (20); t1.left(180); t1.forward (20); t2.left (90); t2.penDown (); t2.forward(60); t3.left (90); t3.penDown (); t3.forward(60); t1.right(90); t1.forward (30); t1.right (90); t1.forward(20); t2.left(180); t2.forward (20); t2.right (90); t2.forward(10); t2.left(180); t2.forward(20); t3.left (180); t3.forward(30); t3.left(90); t3.forward (25); t3.left (90); t3.forward(30); t3.right(180); t3.forward(60); t3.left(90); } function leaveStage() { for(var i= 0; i < 23; i++){ t3.forward(20); t1.setAngleTo(t3); t1.forward(17); t2.setAngleTo(t3); t2.forward(17); t4.setAngleTo(t3); t4.forward(17); } } for(var i = 0; i < 4; i++){ t1.home(); t2.home(); t3.home(); t4.home(); frame(); fth(); t1.penUp(); t2.penUp(); t3.penUp(); t4.penUp(); leaveStage(); }
ausführen