xxxxxxxxxx
var c; var time=1000; var score=0;
function setup()
{
createCanvas(200,200);
colorMode(HSB,26,1,1);
c=int(65+random(26));
}
function draw()
{
if(time>=09
{
background(0);
textSize(100);textAlign(CENTER,CENTER);fill(c-65,1,1);
text(str(char(c)),width/2,height/2);
textSize(15); textAlign(LEFT,TOP); fill(0,0,1);
text("time:"+str(time)+"\nscore:"+str(score),10,10);
}
time--;
}
function keyPressed()
{
if(key==char(c))
{
score++; c=int(65+random(26));
}
}