int wing_original; int dx=1; void setup() { size(500, 500); strokeWeight(5); } void draw() { background(51); wing_original=mouseY; if (frameCount%30>=15) { wing_original+=30; } else { wing_original-=30; } dx=(dx+1)%200; stroke(255); draw_bird(mouseX, mouseY); cloud(dx, 50, 50); cloud(170+dx*0.8, 50, 70); cloud(350+dx*0.9, 80, 60); cloud(dx*1.2, 130, 40); cloud(230+dx*1.2, 150, 40); cloud(100+dx*1.2, 170, 40); } void draw_bird(int x, int y) { line(x, y, x-50, wing_original); //left line(x, y, x+50, wing_original); //right fill(0); ellipse(x, y, 30, 30);noStroke(); fill(255,255,0); triangle(x-5, y, x+5, y, x, y+9);}void cloud(float x, float y, int size) { //100 width noStroke(); fill(#02F0D2); ellipse(x, y, size, size); x+=size/2; ellipse(x, y, size, size); ellipse(x, y-size/4, size, size); ellipse(x, y+size/4, size, size); x+=size/2; ellipse(x, y, size, size); ellipse(x, y-size/4, size, size); ellipse(x, y+size/4, size, size); x+=size/2; ellipse(x, y, size, size); }
วันอาทิตย์ที่ 30 สิงหาคม พ.ศ. 2558
Lab03 : Bird
สมัครสมาชิก:
ส่งความคิดเห็น (Atom)
commit เพิ่มเติม : เพื่ม userstory, bookmark
>> add userstory ทำการเพิ่ม userstory ใน functional tests >> add bookmark for user เพิ่มระบบ Bookmark โดยการสร้าง model ขึ...
-
1 2 3 4 5 6 7 8 9 def setup (): print (d2b( 8 )) def d2b (num): x = "" while num > 0 : x = str ( int (n...
-
1 2 3 4 5 6 7 8 9 10 11 12 13 def test_layout_and_styling ( self ): # Edith goes to the home page self . brow...
-
การใช้ template inheritence คือการสืบทอดเทมเพลต เพื่อให้ไม่ต้องเขียนโค้ดหน้าเว็บๆซ้ำๆ เราจะมีหน้าหลักอันเดียว (base.html or parent) ภายในนั...
ไม่มีความคิดเห็น:
แสดงความคิดเห็น