level 9
暗丶魂岁月
楼主
int x=80; int y=650; int b=670; int a=100;
void setup()
{size(1000,700);
smooth();
}
void draw()
{background(#554D5F);
fill(#0715F5);
rect(x,y,40,40);
rect(x-3,y-5,5,50);
rect(x+40,y-5,5,50);
rect(x+16,y-30,8,40);
fill(#07F509);
ellipse(x+20,y+20,21,21);
fill(255,0,0);
key();
anniu();
//shoot();
}
void key()
{
if(keyPressed &&(key==CODED))
if(keyCode==LEFT){x--;a--;
}
else if(keyCode==RIGHT){x++;a++;
}
else if(keyCode==UP){y--;
}
else if(keyCode==DOWN){y++;
}
}
void anniu()
{ ellipse(950,25,50,25);
fill(250,3,11);
if (mousePressed==true&&dist(mouseX,mouseY,950,25)<50)
{ ellipse(a,b,3,3);
b=b-3;
if (b<=0)
{b=670;
b=b-3;
}
ellipse(950,25,49,24);
fill(214,9,9);
}}
2015年12月25日 17点12分
1
void setup()
{size(1000,700);
smooth();
}
void draw()
{background(#554D5F);
fill(#0715F5);
rect(x,y,40,40);
rect(x-3,y-5,5,50);
rect(x+40,y-5,5,50);
rect(x+16,y-30,8,40);
fill(#07F509);
ellipse(x+20,y+20,21,21);
fill(255,0,0);
key();
anniu();
//shoot();
}
void key()
{
if(keyPressed &&(key==CODED))
if(keyCode==LEFT){x--;a--;
}
else if(keyCode==RIGHT){x++;a++;
}
else if(keyCode==UP){y--;
}
else if(keyCode==DOWN){y++;
}
}
void anniu()
{ ellipse(950,25,50,25);
fill(250,3,11);
if (mousePressed==true&&dist(mouseX,mouseY,950,25)<50)
{ ellipse(a,b,3,3);
b=b-3;
if (b<=0)
{b=670;
b=b-3;
}
ellipse(950,25,49,24);
fill(214,9,9);
}}