public void RotateBanhXe(Graphics g) { banhTrc.FillColor(g, Color.White); banhSau.FillColor(g, Color.White); truc1.B = Transformations.Quay(truc1.B, truc1.A, 30); truc2.B = Transformations.Quay(truc2.B, truc1.A, 30); truc3.B = Transformations.Quay(truc3.B, truc1.A, 30); truc4.B = Transformations.Quay(truc4.B, truc4.A, 30); truc5.B = Transformations.Quay(truc5.B, truc4.A, 30); truc6.B = Transformations.Quay(truc6.B, truc4.A, 30); truc1.Draw(g); truc2.Draw(g); truc3.Draw(g); truc4.Draw(g); truc5.Draw(g); truc6.Draw(g); if (chopDen) { this.fillColorRight(g, Color.Red); this.fillColorLeft(g, Color.Blue); chopDen = false; } else { this.fillColorRight(g, Color.Blue); this.fillColorLeft(g, Color.Red); chopDen = true; } }
public void Cloud(Graphics g) { int a = -1, b = -1; Elip e = new Elip(A, a, b, Color.Black); A = new Point(100, 100); a = 200; b = 100; e = new Elip(A, a, b, Color.Black); e.Draw(g); e.FillColor(g, Color.Aqua); A = new Point(500, 200); a = 100; b = 50; e = new Elip(A, a, b, Color.Black); e.Draw(g); e.FillColor(g, Color.Aqua); A = new Point(1000, 700); a = 150; b = 75; e = new Elip(A, a, b, Color.Black); e.Draw(g); e.FillColor(g, Color.Aqua); }
public void Draw(Graphics g) { int temp = 100; A.X = 200 - temp; A.Y = 500; B.X = 200 - temp; B.Y = 600; Line l = new Line(A, B, Color.Black); l.Draw(g); A.X = 500 - temp; A.Y = 650; l = new Line(A, B, Color.Black); l.Draw(g); B.X = 500 - temp; B.Y = 550; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 200 - temp; A.Y = 500; B.X = 500 - temp; B.Y = 550; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 200 - temp; A.Y = 500; B.X = 500 - temp; B.Y = 400; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 500 - temp; A.Y = 550; B.X = 800 - temp; B.Y = 450; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 200 - temp; A.Y = 570; B.X = 180 - temp; B.Y = 590; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 180 - temp; A.Y = 610; l = new Line(A, B, Color.Black); l.Draw(g); B.X = 520 - temp; B.Y = 670; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 650 - temp; A.Y = 650; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 500 - temp; A.Y = 650; B.X = 670 - temp; B.Y = 630; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 650 - temp; A.Y = 650; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 630 - temp; A.Y = 630; B.X = 630 - temp; B.Y = 600; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 670 - temp; A.Y = 585; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 775 - temp; A.Y = 560; B.X = 800 - temp; B.Y = 550; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 800 - temp; A.Y = 600; l = new Line(A, B, Color.Black); l.Draw(g); B.X = 1305 - temp; B.Y = 450; l = new Line(A, B, Color.Black); l.Draw(g); //mat truoc A.X = 500 - temp; A.Y = 400; B.X = 800 - temp; B.Y = 440; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 920 - temp; A.Y = 250; l = new Line(A, B, Color.Black); l.Draw(g); B.X = 620 - temp; B.Y = 210; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 500 - temp; A.Y = 400; l = new Line(A, B, Color.Black); l.Draw(g); //noc xe A.X = 620 - temp; A.Y = 210; B.X = 1100 - temp; B.Y = 100; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 1320 - temp; A.Y = 140; l = new Line(A, B, Color.Black); l.Draw(g); B.X = 920 - temp; B.Y = 250; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 850; A.Y = 150; B.X = 970; B.Y = 170; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 850; A.Y = 150; B.X = 820; B.Y = 170; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 950; A.Y = 195; l = new Line(B, A, Color.Black); l.Draw(g); B.X = 970; B.Y = 170; l = new Line(A, B, Color.Black); l.Draw(g); B.X = 1000; B.Y = 180; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 970; A.Y = 170; l = new Line(B, A, Color.Black); l.Draw(g); A.X = 900; A.Y = 160; B.X = 870; B.Y = 180; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 920; A.Y = 165; B.X = 890; B.Y = 185; l = new Line(A, B, Color.Black); l.Draw(g); //thanh kinh A.X = 800 - temp; A.Y = 450; B.X = 1400 - temp; B.Y = 280; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 1320 - temp; A.Y = 140; B.X = 1400 - temp; B.Y = 200; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 1400 - temp; A.Y = 280; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 1120 - temp; A.Y = 195; B.X = 1100 - temp; B.Y = 365; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 1080 - temp; A.Y = 370; B.X = 1100 - temp; B.Y = 510; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 1400 - temp; A.Y = 280; B.X = 1430 - temp; B.Y = 320; l = new Line(A, B, Color.Black); l.Draw(g); A.X = 1430 - temp; A.Y = 400; l = new Line(A, B, Color.Black); l.Draw(g); B.X = 1420 - temp; B.Y = 410; l = new Line(A, B, Color.Black); l.Draw(g); //banh truoc A.X = 730 - temp; A.Y = 610; banhTrc = new Elip(A, 60, 70, Color.Black); banhTrc.Draw(g); banhTrc.FillColor(g, Color.Black); banhTrc = new Elip(A, 40, 50, Color.Black); banhTrc.Draw(g); banhTrc.FillColor(g, Color.White); B.X = 740 - temp; B.Y = 560; truc1 = new Line(A, B, Color.Black); truc1.Draw(g); B.X = 785 - temp; B.Y = 625; truc2 = new Line(A, B, Color.Black); truc2.Draw(g); B.X = 690 - temp; B.Y = 650; truc3 = new Line(A, B, Color.Black); truc3.Draw(g); //banh sau A.X = 1360 - temp; A.Y = 420; banhSau = new Elip(A, 60, 70, Color.Black); banhSau.Draw(g); banhSau.FillColor(g, Color.Black); banhSau = new Elip(A, 40, 50, Color.Black); banhSau.Draw(g); banhSau.FillColor(g, Color.White); B.X = 1360 - temp; B.Y = 360; truc4 = new Line(A, B, Color.Black); truc4.Draw(g); B.X = 1410 - temp; B.Y = 430; truc5 = new Line(A, B, Color.Black); truc5.Draw(g); B.X = 1310 - temp; B.Y = 430; truc6 = new Line(A, B, Color.Black); truc6.Draw(g); //đèn A.X = 230 - temp; A.Y = 530; DrawEllipse(A, g, 40, 60); A.X = 430 - temp; A.Y = 560; DrawEllipse(A, g, 45, 65); fillColorRight(g, Color.Blue); fillColorLeft(g, Color.Red); }