2016-11-03 125 views
0

大家好論點我在這裏要求你的幫助 我一直在練習上處理作弄了一個月,但現在我已經開始遇到了一個大問題,現在:停止瞭如果處理

float w=10; //haut 
float x=14; //haut 
float y=10; // bas 
float z=24; // bas 



void setup() { 
frameRate(120); 
size(600,600); 
background (0); 
stroke(255); 
smooth(); 

} 

void draw() { 
println(frameCount); 


line (w,x,y,z); 
w=w+10; 
x=x; 
y=y+10; 
z=z; 
if ((w>580) && (y>580) && (frameCount<601) ) { x=x+30; w=10; 
z=z+30;  y=10;} 

的事情是,我要線條有點從601幀

那樣彎曲:

謝謝s!

回答

0

您的代碼在結尾處缺少}。 這裏有一個可能的語法:

float w=10; //haut 
float x=14; //haut 
float y=10; // bas 
float z=24; // bas 

void setup() { 
    frameRate(120); 
    size(600,600); 
    background (0); 
    stroke(255); 
    smooth(); 
} 

void draw() { 
    println(frameCount); 

    line (w,x,y,z); 
    w=w+10; 
    x=x; 
    y=y+10; 
    z=z; 
    if ((w>580) && (y>580) ) { 
     x=x+30; 
     w=10; 
     z=z+30; 
     if (frameCount<=600){ 
      y = 10; 
     } 
     else{ 
      y = 15; 
     } 
    } 
} 
+0

你還知道如何在同一條線上同時彎曲和彎曲嗎? –

+0

@ClézioDelescluse如果您有後續問題,請將其作爲新問題發佈在其自己的帖子中。但你的第一站應該是[參考](https://processing.org/reference/)。 –