xxxxxxxxxx
51
//let t_size = [20,55,100,35,62,33,42,28];
let t_size = [];
let ch=["c","o","n","f","u","s","e","d"];
let h_pos =[];
let v_pos =[];
let dropunit = 0;
let rot_factor = [0.5,-1,-0.5,1,0.8,-0.3,1,-1];
rot = 0;
function setup() {
createCanvas(400, 400);
textAlign(CENTER,CENTER);
//frameRate(40);
for(let x=0;x<8;x++){
h_pos[x] = random(width);
v_pos[x] = random(height);
t_size[x] = random(15,50);
}
}
function draw() {
//textSize(64);
//text('save me',200,200);
//text(ch[6],200,200);
background(240);
for(let i=0; i<8; i++){
if(v_pos[i] > height+10){
v_pos[i] = -10;
}
push()
dropLetter(i);
pop();
v_pos[i]++;
}
rot ++;
//noLoop();
}
function dropLetter(a){
translate(h_pos[a],v_pos[a]);
rotate(rot*rot_factor[a]*0.1);
textSize(t_size[a]);
text(ch[a],0,0);
}