{求助}编程序的时候出了一点小问题,希望能得到帮助。
processing吧
全部回复
仅看楼主
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
level 9
我的想法是,点右上角的红椭圆就能发射子弹,但子弹永远在y=670的地方发射。
2015年12月25日 17点12分 2
level 9

2015年12月26日 17点12分 3
level 9
我想让子弹发射点跟随tank移动而移动
2015年12月27日 02点12分 4
level 1
搞好了吗?
2016年04月07日 13点04分 5
1