2012年12月4日 星期二
2012年11月13日 星期二
Midterm
1.貼圖
2.程式碼
PImage tt0,tt1,tt2; float bangAngle; int startT=0; int value = 0; int score=0, lastTime=60; PImage img1,big,img2; int now=1; import ddf.minim.*; AudioPlayer player,aaa,cheers; Minim minim; int a=231,b=204,c=185 ; int b1=204,c1=185 ; int b2=204,c2=185 ; int b3=204,c3=185 ; int b4=204,c4=185 ; int b5=204,c5=185 ; int b6=204,c6=185 ; void setup(){ size(500,500); tt0=loadImage("tt0.png"); tt1=loadImage("tt1.png"); tt2=loadImage("tt2.png"); img1=loadImage("b1.png"); big=loadImage("big.png"); img2=loadImage("gameover.png"); } void show1(){ image(img1,0,0); } void show2(){ image(big,0,0); } void show3(){ image(img2,0,0); } void draw() { fill(value); rect(100, 100, 100, 100); size(500,500); int m=millis(); background(255,255,255); image(big,0,0,500,500); textSize(30); fill(m/10%10,m/10%10,m/10%255); text("Time:"+lastTime, 10,40); text("Score:"+score, 330,40); if(lastTime&rt;0) lastTime=60-millis()/1000; else lastTime=0; b-=3;c-=3; b1-=2;c1-=2; b2-=0.1;c2-=0.1; b3-=6;c3-=6; b4-=7;c4-=7; b5-=4;c5-=4; b6-=5;c6-=5; noStroke(); fill(a,b,c); ellipse(300,300,20,20); noStroke(); fill(a,b,c); ellipse(200,130,20,20); noStroke(); fill(a,b1,c1); ellipse(360,230,20,20); noStroke(); fill(a,b2,c2); ellipse(192,270,20,20); noStroke(); fill(a,b3,c3); ellipse(170,190,10,10); noStroke(); fill(a,b4,c4); ellipse(150,160,18,18); noStroke(); fill(a,b5,c5); ellipse(130,210,30,30); noStroke(); fill(a,b6,c6); ellipse(220,250,20,20); noStroke(); fill(a,b1,c1); ellipse(240,150,17,17); noStroke(); fill(a,b2,c2); ellipse(300,190,20,20); noStroke(); fill(a,b4,c4); ellipse(280,260,30,30); noStroke(); fill(a,b5,c5); ellipse(270,390,10,10); noStroke(); fill(a,b6,c6); ellipse(235,330,30,30); noStroke(); fill(a,b,c); ellipse(150,370,20,20); noStroke(); fill(a,b1,c1); ellipse(100,250,15,15); noStroke(); fill(a,b2,c2); ellipse(300,300,20,20); noStroke(); fill(a,b3,c3); ellipse(350,350,30,30); if (b<0 ) { b=255; c=255;} if (b1<0 ) { b1=255; c1=255;} if (b2==0 ) { b2=255; c2=255;} if (b3<0 ) { b3=255; c3=255;} if (b4<0 ) { b4=255; c4=255;} if (b5<0 ) { b5=255; c5=255;} if (b6<0 ) { b6=255; c6=255;} if(mouseX&rt;290 && mouseX < 310 && mouseY&rt;290 && mouseY<310 && mousePressed)image(tt2,290,280,30,30);//又嘴 else if(mouseX&rt;190 && mouseX < 210 && mouseY&rt;120 && mouseY<140 && mousePressed)image(tt2,190,115,30,30);//額頭 else if(mouseX&rt;350 && mouseX < 370 && mouseY&rt;220 && mouseY<240 && mousePressed)image(tt2,350,210,30,30);//右邊 else if(mouseX&rt;180 && mouseX < 200 && mouseY&rt;260 && mouseY<280 && mousePressed)image(tt2,180,250,30,30);//左 else if(mouseX&rt;160 && mouseX < 180 && mouseY&rt;180 && mouseY<200 && mousePressed)image(tt2,160,180,20,20); else if(mouseX&rt;140 && mouseX < 160 && mouseY&rt;150 && mouseY<170 && mousePressed)image(tt2,140,145,25,25); else if(mouseX&rt;120 && mouseX < 140 && mouseY&rt;200 && mouseY<220 && mousePressed)image(tt2,115,185,45,45); else if(mouseX&rt;210 && mouseX < 230 && mouseY&rt;240 && mouseY<260 && mousePressed)image(tt2,210,235,27,27); else if(mouseX&rt;230 && mouseX < 250 && mouseY&rt;140 && mouseY<150 && mousePressed)image(tt2,230,140,26,26); else if(mouseX&rt;290 && mouseX < 310 && mouseY&rt;180 && mouseY<200 && mousePressed)image(tt2,290,180,25,25); else if(mouseX&rt;270 && mouseX < 290 && mouseY&rt;250 && mouseY<270 && mousePressed)image(tt2,260,235,45,45); else if(mouseX&rt;260 && mouseX < 280 && mouseY&rt;380 && mouseY<400 && mousePressed)image(tt2,260,380,17,17); else if(mouseX&rt;220 && mouseX < 245 && mouseY&rt;320 && mouseY<340 && mousePressed)image(tt2,220,300,49,49); else if(mouseX&rt;140 && mouseX < 160 && mouseY&rt;360 && mouseY<380 && mousePressed)image(tt2,140,350,30,30); else if(mouseX&rt;90 && mouseX < 110 && mouseY&rt;240 && mouseY<260 && mousePressed)image(tt2,90,235,26,26); else if(mouseX&rt;290 && mouseX < 310 && mouseY&rt;290 && mouseY<310 && mousePressed)image(tt2,290,290,30,30); else if(mouseX&rt;340 && mouseX < 360 && mouseY&rt;340 && mouseY<360 && mousePressed)image(tt2,325,325,41,41); if(now==1){ show1(); if(mouseX&rt;200 && mouseX<330 && mouseY&rt;300 && mouseY<430 && mousePressed){ now=2; } } if(lastTime==0) //當時間=0,秀出得分 { stop(); show3(); textFont(createFont("Calibri", 40)); fill(128,0,0); text("Your score:"+score,150,300); // cheers=minim.loadFile("cheers.wav", 2048); //cheers.play(); } } void mousePressed() { if ( mouseX&rt;180 && mouseX < 200 && mouseY&rt;260 && mouseY<280) { value = 255; score+=10; minim=new Minim(this); aaa=minim.loadFile("aaa.wav", 2048); //戳到泡泡時播放音效 aaa.play(); } else if (mouseX&rt;350 && mouseX < 370 && mouseY&rt;220 && mouseY<240) { value = 255; score+=10; minim=new Minim(this); aaa=minim.loadFile("aaa.wav", 2048); //戳到泡泡時播放音效 aaa.play(); } else if (mouseX&rt;190 && mouseX < 210 && mouseY&rt;120 && mouseY<140) { value = 255; score+=10; minim=new Minim(this); aaa=minim.loadFile("aaa.wav", 2048); //戳到泡泡時播放音效 aaa.play(); } else if (mouseX&rt;290 && mouseX < 310 && mouseY&rt;290 && mouseY<310) { value = 255; score+=10; minim=new Minim(this); aaa=minim.loadFile("aaa.wav", 2048); //戳到泡泡時播放音效 aaa.play(); } else if (mouseX&rt;160 && mouseX < 180 && mouseY&rt;180 && mouseY<200) { value = 255; score+=100; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;140 && mouseX < 160 && mouseY&rt;150 && mouseY<170) { value = 255; score+=10; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;120 && mouseX < 140 && mouseY&rt;200 && mouseY<220) { value = 255; score+=1; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;210 && mouseX < 230 && mouseY&rt;240 && mouseY<260) { value = 255; score+=10; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;230 && mouseX < 250 && mouseY&rt;140 && mouseY<150) { value = 255; score+=10; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;290 && mouseX < 310 && mouseY&rt;180 && mouseY<200) { value = 255; score+=10; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;270 && mouseX < 290 && mouseY&rt;250 && mouseY<270) { value = 255; score+=1; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;260 && mouseX < 280 && mouseY&rt;380 && mouseY<400) { value = 255; score+=100; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;220 && mouseX < 245 && mouseY&rt;320 && mouseY<340) { value = 255; score+=1; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;90 && mouseX < 110 && mouseY&rt;240 && mouseY<260) { value = 255; score+=10; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;140 && mouseX < 160 && mouseY&rt;360 && mouseY<380) { value = 255; score+=10; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;290 && mouseX < 310 && mouseY&rt;290 && mouseY<310) { value = 255; score+=10; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else if (mouseX&rt;340 && mouseX < 360 && mouseY&rt;340 && mouseY<360) { value = 255; score+=1; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} else { value = 0; score-=50; minim=new Minim(this);aaa=minim.loadFile("aaa.wav", 2048);aaa.play();} }3.遊戲規則
點到痘痘就可得分
大顆1分
小顆100分
點到臉扣50分
點到痘痘會有"啵~"的聲音
限時60秒
時間歸零即遊戲結束
4.心得
完成一個作品蠻有成就感的,雖然沒有做到很完美,但是一步步寫出來,遇到問題一起討論然後解決他,感覺真的有學到東西。
2012年10月30日 星期二
HW08,week08
1. 請寫下以下資料:
1.1. 你之前完成了什麼?
製作遊戲所需要的素材,例如痘痘,和爆掉的痘痘。
1.2. 你今天計畫要做什麼?
讓痘痘越來越成熟,用滑鼠點擊就會爆開。
1.3. 可能會遇到的問題... (及可能的解決方法)
(1)痘痘漸層的顏色是從黑色開始變紅,想要讓他從膚色開始。
(2)現在點擊痘痘只會爆開一下子就變回原本痘痘的圖,想要讓他可以一直停在爆開痘痘的圖。
2. 請把你目前期中作品的進度貼出來
1.1. 你之前完成了什麼?
製作遊戲所需要的素材,例如痘痘,和爆掉的痘痘。
1.2. 你今天計畫要做什麼?
讓痘痘越來越成熟,用滑鼠點擊就會爆開。
1.3. 可能會遇到的問題... (及可能的解決方法)
(1)痘痘漸層的顏色是從黑色開始變紅,想要讓他從膚色開始。
(2)現在點擊痘痘只會爆開一下子就變回原本痘痘的圖,想要讓他可以一直停在爆開痘痘的圖。
2. 請把你目前期中作品的進度貼出來
2012年10月23日 星期二
2012年10月16日 星期二
2012年10月9日 星期二
week5,hw5
1.
void setup(){ size(600,600); } float aaa,bbb,ccc; void draw(){ background(213,255,149); translate(300,300); fill(255,174,201); noStroke(); rotate(aaa+=0.05); for(int i=0;i<16;i++){ rotate( PI/8); ellipse(100,0,200,45); } fill(255,255,128); stroke(255,255,255); ellipse(0,0,50,50); translate(300,300); fill(255,4,20); noStroke(); rotate(ccc+=-0.01); for(int i=0;i<16;i++){ rotate( PI/8); ellipse(10,0,200,30); } translate(300,300); fill(255,201,14); noStroke(); rotate(bbb+=-0.1); for(int i=0;i<16;i++){ rotate( PI/8); ellipse(50,0,200,50); } }
void setup(){ size(600,600); } float aaa,bbb,ccc; void draw(){ background(213,255,149); if(mousePressed){ translate(mouseX,mouseY); fill(255,174,201); noStroke(); rotate(aaa+=0.05); for(int i=0;i<16;i++){ rotate( PI/8); ellipse(100,0,200,45); } fill(255,255,128); stroke(255,255,255); ellipse(0,0,50,50); translate(300,300); fill(255,4,20); noStroke(); rotate(ccc+=-0.01); for(int i=0;i<16;i++){ rotate( PI/8); ellipse(10,0,200,30); } translate(300,300); fill(255,201,14); noStroke(); rotate(bbb+=-0.1); for(int i=0;i<16;i++){ rotate( PI/8); ellipse(50,0,200,50); } } } 3.
我們想做擠痘痘遊戲,然後結合感應手套,就像真的用手擠痘痘一樣,做出緊張刺激好玩有趣的互動小遊戲。
2012年10月2日 星期二
WEEK04,HW04
void setup() { size(500,400); background(255,255,255); fill(255,128,128); rect(0,0,50,50); fill(0,128,255); rect(0,50,50,50); fill(128,255,128); rect(0,100,50,50); fill(255,255,128); rect(0,150,50,50); fill(255,128,64); rect(0,200,50,50); fill(255,255,255); rect(0,250,50,50); fill(0,0,0); rect(0,300,50,50); fill(121,121,121); rect(0,350,50,50); fill(255,255,255); rect(0,400,50,50); fill(255,215,227);rect(450,350,50,50); fill(215,234,255);rect(400,350,50,50); fill(255); rect(450,0,50,50); ellipse(475, 25, 2,2); rect(450,50,50,50); ellipse(475, 75, 6, 6); rect(450,100,50,50); ellipse(475, 125, 10,10); rect(0,250,50,50); strokeWeight(1); } void draw() { if(mouseX&rt;450 && mouseX<500 && mouseY&rt;0 && mouseY<50 && mousePressed)strokeWeight(3); else if(mouseX&rt;450 && mouseX<500 && mouseY&rt;50 && mouseY<100 && mousePressed)strokeWeight(6); else if(mouseX&rt;450 && mouseX<500 && mouseY&rt;100 && mouseY<150 && mousePressed)strokeWeight(10); else if(mouseX < 50 && mouseY<50 && mousePressed)stroke(255,128,128); else if(mouseX < 50 && mouseY<100 && mousePressed)stroke(0,128,255); else if(mouseX < 50 && mouseY<150 && mousePressed)stroke(128,255,128); else if(mouseX < 50 && mouseY<200 && mousePressed)stroke(255,255,128); else if(mouseX < 50 && mouseY<250 && mousePressed)stroke(255,128,64); else if(mouseX < 50 && mouseY<300 && mousePressed)stroke(255,255,255); else if(mouseX < 50 && mouseY<350 && mousePressed)stroke(0,0,0); else if(mouseX < 50 && mouseY<400 && mousePressed)stroke(121,121,121); else if(mouseX&rt;450 && mouseX<500 && mouseY&rt;350 && mouseY<400 && mousePressed)save("001.png"); else if(mouseX&rt;400 && mouseX<450 && mouseY&rt;350 && mouseY<400 && mousePressed)loadImage("001.png"); else if(mousePressed) { line(mouseX,mouseY,pmouseX,pmouseY); } }
2012年9月18日 星期二
Week02,Hw02
size(600,600); for(int i=0;i<50 data-blogger-escaped-i="i" data-blogger-escaped-span="span" style="color: #cc6600;">fill(random(255),random(255),random(255)); rect(random(500),random(500),random(300),random(300)); }
size(500,500);
background(255,130,190);
for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/30,k*255/40,150);
ellipse(i*10,random(500),10,10);
}
}
size(500,500);
background(255,130,190);
for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/3,k*255/4,90);
ellipse(i*100+50,k*100+50,100,100);
}
}
for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/6,k*255/5,90);
ellipse(i*100+50,k*100+50,60,60);
}
}
for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/2,k*255/1,200);
ellipse(i*100+60,k*100+40,25,25);
}
}
for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/2,k*255/1,200);
ellipse(i*100+40,k*100+60,25,25);
}
}
for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/2,k*255/1,200);
ellipse(i*100+40,k*100+40,25,25);
}
}for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/2,k*255/1,200);
ellipse(i*100+60,k*100+60,25,25);
}
}
for(int i=0;i<50;i++)
{
for(int k=0;k<50;k++)
{noStroke();
fill(i*255/4,k*255/3,90);
ellipse(i*100+50,k*100+50,15,15);
}
}
2012年9月11日 星期二
week01 hw01
1.
2.
2.
size(450,450); PImage kitty; kitty = loadImage("http://www.cmakers.org/Img/kitty_artwork_04.gif"); image(kitty,20,20);
3.
4.
我在今天的課堂中,一開始看學長姐的作品,雖然覺得很有趣,但是感覺會很難,有點害怕會做不出來,不過上課後教了新的程式,從很簡單的地方開始學,我覺得很有趣,也很想繼續學,希望到了學期末也可以做出像學長姐們的一樣優秀的作品來。
訂閱:
文章 (Atom)
















