Add files via upload

This commit is contained in:
Daniel
2024-01-17 21:53:56 +02:00
committed by GitHub
parent 1c39199cc3
commit 7e04c3a9ef
8 changed files with 101 additions and 25 deletions

View File

@@ -6,11 +6,20 @@ class Block {
boolean isFlower;
int treeSize;
color treeColor;
ArrayList<Particle> particles = new ArrayList<>();
Block(int x, int y, float h, color treeColor, int treeSize) {
this.x = x;
this.y = y;
this.h = h;
this.treeColor = treeColor;
this.treeSize = treeSize;
for (int i = 0; i < 4; i++) {
float angleInRadians = map(i, 0, 10, 0, TWO_PI);
particles.add(new Particle(cubeWidth * cos(angleInRadians), cubeWidth * sin(angleInRadians), 0, this, random(0.5, 1), h/2));
}
}
void drawParticles(float posZ) {
particles.forEach(particle -> particle.display(posZ));
}
}