大神求教!新手一枚,要完成作业。 好人~
processing吧
全部回复
仅看楼主
level 1
[乖]要求让小人跟随鼠标移动,每移动一次眼睛要变颜色,尽可能小腿也跟着动。
后天要交作业,急[泪]
void setup() {
// Set the size of the window
size(200,200);
}
void draw() {
// Draw a white background
background(255);
// Set CENTER mode
ellipseMode(CENTER);
rectMode(CENTER);
// Draw Zoog's body
stroke(0);
fill(150);
rect(100,100,20,100);
// Draw Zoog's head
stroke(0);
fill(255);
ellipse(100,70,60,60);
// Draw Zoog's eyes
fill(0);
ellipse(81,70,16,32);
ellipse(119,70,16,32);
// Draw Zoog's legs
stroke(0);
line(90,150,80,160);
line(110,150,120,160);
}
2016年03月12日 08点03分 1
level 1
拜托~拜托啊[泪]为嘛没有人啊[哭泣]
2016年03月12日 08点03分 2
level 8
大概可以满足要求,但是小腿不知道该怎么动才能和谐,你可以画个小腿运动的草图我看看
float x=100;
float y=70;
float r,g,b;
void setup() {
// Set the size of the window
size(600,400);
}
void draw(){
background(255);
x=x+0.05*(mouseX-x);
y=y+0.05*(mouseY-y);
drawZoog(x,y);
if(mouseX!=pmouseX){
r=random(360);
g=random(360);
b=random(360);}
}
void drawZoog(float zx,float zy) {
// Set CENTER mode
ellipseMode(CENTER);
rectMode(CENTER);
// Draw Zoog's body
stroke(0);
fill(150);
rect(zx,30+zy,20,100);
// Draw Zoog's head
stroke(0);
fill(255);
ellipse(zx,zy,60,60);
// Draw Zoog's eyes
fill(r,g,b);
ellipse(zx-19,zy,16,32);
ellipse(zx+19,zy,16,32);
// Draw Zoog's legs
stroke(0);
line(zx-10,zy+80,zx-20,zy+90);
line(zx+10,zy+80,zx+20,zy+90);
}
2016年03月13日 02点03分 3
level 5
这些够了,谢谢大神[真棒]不过刚入门,有点看不懂[黑线]
还是要谢谢啦(ps:我是楼主)
2016年03月13日 08点03分 4
1