Desenho do mario em java-codigo

Disponível somente no TrabalhosFeitos
  • Páginas : 7 (1716 palavras )
  • Download(s) : 0
  • Publicado : 12 de junho de 2012
Ler documento completo
Amostra do texto
Mario!

1° Colocar um painel de 460 por 380! Chama-lo de P1!
2° Colocar um botão e chama-lo de B1!colocar um evento!

CODIGO:

private void Desenho(Graphics g){
Color corp=new Color(221,163,89);
Color corc=new Color(57,29,18);
Color corr=new Color(238,27,33);
Color corl=new Color(228,105,0);
Color corg=new Color(254,212,119);
Colorcorpi=new Color(167,66,22);
Color corceu=new Color(108,137,254);
Color corcer=new Color (131,52,17);
Color corarv=new Color (34,179,76);

g.setColor(corceu);
g.fillRect(0,0,460,360);

g.setColor(corpi);
g.fillRect(270,110,460,40);
Polygon pic=new Polygon();
pic.addPoint(270,126);pic.addPoint(342,126);
pic.addPoint(342,111);
pic.addPoint(349,111);
pic.addPoint(349,126);
pic.addPoint(460,126);
pic.addPoint(460,133);
pic.addPoint(418,133);
pic.addPoint(418,150);
pic.addPoint(411,150);
pic.addPoint(411,133);
pic.addPoint(280,133);
pic.addPoint(280,150);
pic.addPoint(273,150);pic.addPoint(273,134);
pic.addPoint(270,134);
g.setColor(corcer);
g.fillPolygon(pic);

g.setColor(corpi);
g.fillRect(0,340,460,380);
Polygon pi=new Polygon();
pi.addPoint(0,355);
pi.addPoint(100,355);
pi.addPoint(100,340);
pi.addPoint(110,340);
pi.addPoint(110,355);pi.addPoint(320,355);
pi.addPoint(320,340);
pi.addPoint(330,340);
pi.addPoint(330,355);
pi.addPoint(460,355);
pi.addPoint(460,365);
pi.addPoint(410,365);
pi.addPoint(410,380);
pi.addPoint(400,380);
pi.addPoint(400,365);
pi.addPoint(220,365);
pi.addPoint(220,380);
pi.addPoint(210,380);pi.addPoint(210,365);
pi.addPoint(10,365);
pi.addPoint(10,380);
pi.addPoint(0,380);
g.setColor(corcer);
g.fillPolygon(pi);

Polygon arv=new Polygon();
arv.addPoint(323,340);
arv.addPoint(442,222);
arv.addPoint(446,220);
arv.addPoint(449,219);
arv.addPoint(452,218);arv.addPoint(456,218);
arv.addPoint(459,219);
arv.addPoint(460,221);
arv.addPoint(460,340);
g.setColor(corarv);
g.fillPolygon(arv);
g.setColor(Color.red);
g.fillOval(439,243,10,10);
g.setColor(Color.red);
g.fillOval(385,295,10,10);
g.setColor(Color.red);
g.fillOval(450,309,8,8);Polygon bone=new Polygon();
bone.addPoint(130,180);
bone.addPoint(180,180);
bone.addPoint(180,190);
bone.addPoint(210,190);
bone.addPoint(210,200);
bone.addPoint(120,200);
bone.addPoint(120,190);
bone.addPoint(130,190);
g.setColor(Color.red);
g.fillPolygon(bone);
Polygon cab1=newPolygon();
cab1.addPoint(120,200);
cab1.addPoint(150,200);
cab1.addPoint(150,210);
cab1.addPoint(140,210);
cab1.addPoint(140,220);
cab1.addPoint(150,220);
cab1.addPoint(150,230);
cab1.addPoint(130,230);
cab1.addPoint(130,210);
cab1.addPoint(120,210);
g.setColor(corc);
g.fillPolygon(cab1);Polygon ros=new Polygon();
ros.addPoint(150,200);
ros.addPoint(170,200);
ros.addPoint(170,220);
ros.addPoint(180,220);
ros.addPoint(180,230);
ros.addPoint(170,230);
ros.addPoint(170,240);
ros.addPoint(200,240);
ros.addPoint(200,250);
ros.addPoint(130,250);
ros.addPoint(130,230);...
tracking img