Good morning everyone,
I just started using processing.
I’m drawing a sketch where I’m going to create 30 little balls.
There’s a way to make them appear in sequence without writing 30 times the same line with the ellipse?
Thanks in advance
Good morning everyone,
I just started using processing.
I’m drawing a sketch where I’m going to create 30 little balls.
There’s a way to make them appear in sequence without writing 30 times the same line with the ellipse?
Thanks in advance
Hello,
:)
I encourage you to review the resources available here:
Very Nice! Thank you
you can also work with arrays (lists) and the for loop over the arrays (see tutorial)
for example first array x[], then y[] then speedX[] and speedY[]
so the properties of ONE ball is in the arrays in the same line each.(one ball properties in each array, in the same line)
for(int i........) {
ellipse(x[i], y[i], 7,7);
x[i] = x[i] + speedX[i];
y[i] = y[i] + speedY[i];
}
I’ll try it today
Thank you very much