xxxxxxxxxx
//参照 http://processingnyumon.blog.jp/archives/2290701.html
final float GRAVITY=9.8;
float speed=0;
float y;
float x;
int bingo=0;
float goodx=0;
float goody=0;
float kasoku=0;
void setup(){
size(500,500);
x=250;
fill(0);
textSize(35);
text("Take note with mouse",50,25,400,50);
// 日本語フォントを選択指定する呪文
PFont font = createFont("MS Gothic",48,true);
textFont(font);// 選択したフォントを使用する
textSize(40); // フォントの表示サイズ
fill(255,0,0);// フォントの色 赤
}
void draw(){
background(255);
speed+=9.8/60+kasoku;
y+=speed;
smooth();
noStroke();
fill(200);
//ellipse(x,y,50,50);
text("♪",x, y);
//text("Take note with mouse",x+50, y-50);
if(y>500-25){
speed=-speed*0.6;
y=500-25;
}
if(mouseX>x-25 && mouseX<x+25 &&
mouseY>y-25 && mouseY<y+25){
bingo=60;
reset();
kasoku+=0.01;
goodx=mouseX;
goody=mouseY;
}
if(bingo>0){
fill(0);
text("good!",goodx,goody);
bingo-=1;
}
}
void reset(){
y=-50;
speed=0;
x=50+random(400);
}