I have the following code:
MinhaClasse[] obj = new MinhaClasse[QtdUsuario];
Thread th;
For(int i = 0; i < QtdUsuario; i++)
{
obj[i] = new MinhaClasse();
th = new Thread(new ParameterizedThreadStart(Metodo));
th.SetApartmentState(ApartmentState.STA);
th.IsBackground = true;
th.Start(obj[i]);
}
Each object displays an image on the screen, and these images move around the screen.
Ex: If the user sets the variable QtdUsuario
to 5
I will have 5 objects and each object in a thread. Then on the screen I will have 5 images moving randomly.
My goal is:
How can I identify possible collisions between these objects (images)?
And how can I define individual values for each object?
Ex: the user will say that image 1 will have idade
= 5, and decrements e or increases
this idade
?