Java/Processing Digital Letter Rain, I need help with animation, look in the PDF!

SquidXTV

Neues Mitglied
Can someone tell me how I can do that.

https://docdro.id/n2azewz
[CODE lang="java" title="My Code" highlight="36-44"]String genString;
String[] fill = new String[50];
int pressed = 0, fArray = 0;

void setup(){
frameRate(10);
size(750, 750);
textAlign(CENTER, TOP);
textSize(15);
background(0);
updateBottoms(generateBottoms(), generateSpeeds());
drawDroplets(fillArray(), generateBottoms(), generateLengths());
}

void draw(){

}

void keyPressed(){
if((key == 'm' || key == 'M') && pressed == 0){
pressed++;
fill(255);
showAll(fillArray());
}
}

//updateBottoms
void updateBottoms(int[] dropletBottom, int[] speed){
for(int i = 0; i <= 49; i++){
if(dropletBottom < 50){
dropletBottom += speed;
}
}
}

//drawDroplets
void drawDroplets(String[] letters, int[] dropletBottom, int[] dropletLength){
for(int j = 0; j <= 49; j++){
for(int i = 0; i <= 49; i++){


}
}
}

//generateBottoms function
int[] generateBottoms(){
int[] bottom = new int[50];
for(int i = 0; i <= 49; i++){
bottom = (int) random(0, 50);
}
return bottom;
}

//generateSpeeds function
int[] generateSpeeds(){
int[] speed = new int[50];
for(int i = 0; i <= 49; i++){
speed = (int) random(1, 6);
}
return speed;
}

//generateLengths function
int[] generateLengths(){
int[] lengths = new int[50];
for(int i = 0; i <= 49; i++){
lengths = (int) random(10, 26);
}
return lengths;
}


//generateString function
String generateString(){
genString = "";
char c;
for(int i = 1; i <= 50; i++){
c = (char) random('A', 'Z'+1);
genString += c;
}
return genString;
}

//fillArray function
String[] fillArray(){
if(fArray == 0){
for(int i = 0; i <= 49; i++){
fill = generateString();
}
fArray++;
}
return fill;
}

//showAll function
void showAll(String [] droplets){
char c;
for(int j = 0; j <= 49; j++){
for(int i = 0; i <= 49; i++){
c = droplets[j].charAt(i);
text(c, (j+0.3)*15, i*15);
}
}
}[/CODE]
 

mihe7

Top Contributor
Can someone tell me how I can do that.
  1. People won't do your homework but act on the principle of helping to help yourself.
  2. First aid: follow closely the given instructions.
  3. Whenever you encounter problems, don't hesitate to ask. Try to describe the problem as detailed as possible. The more detailed, the better your chance to get an useful answer.
 

Neue Themen


Oben