1.今天進度
boolean a1=false;
boolean s1=false;
boolean d1=false;
boolean f1=false;
boolean z1=false;
boolean x1=false;
boolean c1=false;
boolean v1=false;
boolean y1=false;
boolean u1=false;
boolean i1=false;
boolean o1=false;
boolean h1=false;
boolean j1=false;
boolean k1=false;
boolean l1=false;
int sice=0;
int siceten=0;
void setup(){
size(600,650);
}
void draw()
{
background(255);
fill(255);
/////////////////////////////////////////////第一排
rect(50, 100, 100, 100);
rect(180, 100, 100, 100);
rect(310, 100, 100, 100);
rect(440, 100, 100, 100);
///////////////////////////////////////////////第二排
rect(50, 230, 100, 100);
rect(180, 230, 100, 100);
rect(310, 230, 100, 100);
rect(440, 230, 100, 100);
//////////////////////////////////////////////第三排
rect(50, 360, 100, 100);
rect(180, 360, 100, 100);
rect(310, 360, 100, 100);
rect(440, 360, 100, 100);
//////////////////////////////////////////////第四排
rect(50, 490, 100, 100);
rect(180, 490, 100, 100);
rect(310, 490, 100, 100);
rect(440, 490, 100, 100);
/////////////////////////////////////////////////////////
if(a1)
{
fill(0);
rect(50, 100, 100, 100);
}
if(s1)
{
fill(0);
rect(180, 100, 100, 100);
}
if(d1)
{
fill(0);
rect(310, 100, 100, 100);
}
if(f1)
{
fill(0);
rect(440, 100, 100, 100);
}
/////////////////////////////////////////////////////第一排
if (z1)
{
fill(0);
rect(50, 230, 100, 100);
}
if(x1)
{
fill(0);
rect(180, 230, 100, 100);
}
if(c1)
{
fill(0);
rect(310, 230, 100, 100);
}
if(v1)
{
fill(0);
rect(440, 230, 100, 100);
}
//////////////////////////////////////////第二排
if (y1)
{
fill(0);
rect(50, 360, 100, 100);
}
if(u1)
{
fill(0);
rect(180, 360, 100, 100);
}
if(i1)
{
fill(0);
rect(310, 360, 100, 100);
}
if(o1)
{
fill(0);
rect(440, 360, 100, 100);
}
/////////////////////////////////////////////////////////////第三排
if (h1)
{
fill(0);
rect(50, 490, 100, 100);
}
if(j1)
{
fill(0);
rect(180, 490, 100, 100);
}
if(k1)
{
fill(0);
rect(310, 490, 100, 100);
}
if(l1)
{
fill(0);
rect(440, 490, 100, 100);
}
////////////////////////////////////////////////////////////////第四排////////////X+50.Y+80
if(sice==1)
{
fill(0);
rect(450, 280, 20, 60);
rect(450, 360, 20, 60);
}
if(siceten==1)
{
fill(0);
rect(300, 280, 20, 60);
rect(300, 360, 20, 60);
}
if(sice==2)
{
fill(0);
rect(390,260,60,20);
rect(450, 280, 20, 60);
rect(390,340,60,20);
rect(370, 360, 20, 60);
rect(390,420,60,20);
}
if(sice==3)
{
fill(0);
rect(390,260,60,20);
rect(450, 280, 20, 60);
rect(390,340,60,20);
rect(450, 360, 20, 60);
rect(390,420,60,20);
}
if(sice==4)
{
fill(0);
rect(370, 280, 20, 60);
rect(450, 280, 20, 60);
rect(390,340,60,20);
rect(450, 360, 20, 60);
}
if(sice==5)
{
fill(0);
rect(390,260,60,20);
rect(370, 280, 20, 60);
rect(390,340,60,20);
rect(450, 360, 20, 60);
rect(390,420,60,20);
}
if(sice==6)
{
fill(0);
rect(390,260,60,20);
rect(450, 280, 20, 60);
rect(390,340,60,20);
rect(450, 360, 20, 60);
rect(390,420,60,20);
rect(370, 360, 20, 60);
}
if(sice==7)
{
fill(0);
rect(390,260,60,20);
rect(450, 280, 20, 60);
rect(450, 360, 20, 60);
}
if(sice==8)
{
fill(0);
rect(390,260,60,20);
rect(450, 280, 20, 60);
rect(390,340,60,20);
rect(450, 360, 20, 60);
rect(390,420,60,20);
rect(370, 360, 20, 60);
rect(370, 280, 20, 60);
}
if(sice==9)
{
fill(0);
rect(390,260,60,20);
rect(450, 280, 20, 60);
rect(390,340,60,20);
rect(450, 360, 20, 60);
rect(390,420,60,20);
// rect(320, 280, 20, 60);
rect(370, 280, 20, 60);
}
if(sice==0)
{
fill(0);
rect(390,260,60,20);
rect(450, 280, 20, 60);
// rect(390,340,60,20);
rect(450, 360, 20, 60);
rect(390,420,60,20);
rect(370, 360, 20, 60);
rect(370, 280, 20, 60);
}
}
void keyPressed(){
if(key=='a'|| key == 'A'){
a1=true;
}
else if(key=='s'|| key == 'S'){
s1=true;
}
else if(key=='d'|| key == 'D')
{
d1=true;
}
else if(key=='f'|| key == 'F')
{
f1=true;
}
if(key=='z'|| key == 'Z'){
z1=true;
}
else if(key=='x'|| key == 'X'){
x1=true;
}
else if(key=='c'|| key == 'C')
{
c1=true;
}
else if(key=='v'|| key == 'V')
{
v1=true;
}
if(key=='y'|| key == 'Y'){
y1=true;
}
else if(key=='u'|| key == 'U'){
u1=true;
}
else if(key=='i'|| key == 'I')
{
i1=true;
}
else if(key=='o'|| key == 'O')
{
o1=true;
}
if(key=='h'|| key == 'H'){
h1=true;
}
else if(key=='j'|| key == 'J'){
j1=true;
}
else if(key=='k'|| key == 'K')
{
k1=true;
}
else if(key=='l'|| key == 'L')
{
l1=true;
}
}
void keyReleased(){
if(key=='a'|| key == 'A')
{
a1=false;
if(sice<10)
{
sice++;
}
if(sice==10)
{
sice=0;
if(siceten<10)
{
siceten++;
}
}
}
if(key=='s'|| key == 'S'){
s1=false;
}
if(key=='d'|| key == 'D')
{
d1=false;
}
else if(key=='f'|| key == 'F')
{
f1=false;
}
else if(key=='z'|| key == 'Z')
{
z1=false;
}
if(key=='x'|| key == 'X'){
x1=false;
}
if(key=='c'|| key == 'C')
{
c1=false;
}
else if(key=='v'|| key == 'V')
{
v1=false;
}
if(key=='y'|| key == 'Y'){
y1=false;
}
else if(key=='u'|| key == 'U'){
u1=false;
}
else if(key=='i'|| key == 'I')
{
i1=false;
}
else if(key=='o'|| key == 'O')
{
o1=false;
}
if(key=='h'|| key == 'H'){
h1=false;
}
else if(key=='j'|| key == 'J'){
j1=false;
}
else if(key=='k'|| key == 'K')
{
k1=false;
}
else if(key=='l'|| key == 'L')
{
l1=false;
}
}
加入計分系統