CodingTrain / CodingTrain/Suggestion-Box

[HELP] ellipses not drawing, things not working...why?

Open
#638 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
570
Forks
85
PR merge metrics
No merged PRs in 30d

Description

Okay, so I've been trying to generate branches of balls with this code. I've been trying different aproaches since 3 days ago and things do not work for some reason. Please If anyone could take a look I would be very grateful.

`ArrayList galhos = new ArrayList();
float raio_in;
int max_iteracoes = 100;
int it = 0;

void setup(){
size(600,600);
background(170);
raio_in = width/30;
PVector primeira_pos_mae = new PVector(width/2,0);
PVector primeiro_aponta = new PVector(0,raio_in*1,2);
galhos.add(new bgalho(primeira_pos_mae, primeiro_aponta, raio_in, 1)); //EN: generates the first one;

//EN: Debugging to see if its working
noStroke();
fill(255);
ellipse(galhos.get(0).pos.x, galhos.get(0).pos.y, 2*raio_in, 2*raio_in);
println(galhos.get(0).pos);
}

void draw(){

//EN: shows every object
for(int j=0; j 98){
PVector aponta2 = new PVector();
aponta2 = aponta.copy();
aponta2.rotate(random(PI/2-PI/6, PI/2+PI/6));
galhos.add(new bgalho(pos, aponta2, novo_raio, nova_ger));

//EN: debugging to see if it is actually working:
println("lucky!");
stroke(255);
line(pos.x, pos.y, pos.x +aponta.x, pos.y +aponta.y);
}

//depois de proliferar/crescer é mãe
//EN: after it proliferates/grows it becomes a "mother" and no longer does this.
mae = true;
it++;
}

void mostra(){ //EN: show function
noStroke();
fill(0, 255-geracao);
ellipse(pos.x, pos.y, 2*raio, 2*raio);
}

}`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.