Hello guys,
I am working with dynamic objects in my program.
Very simple,
A Vector is hosting all objects created and with a for loop I go through all of them one at a time calling their methods and changing their behavior.
So far so good.
However, After I have like 100 Objects in there, the loop is big and the single thread gets slow (the animations are on/off the objects perform on screen) so I thought "There must be a way to spawn another thread? or one thread for every 5 of them?".
And if I can do that and create threads, then I can put a thread inside the super class so all subclass (objects) inherit the code from it and perform everything on their own thread?
Lots of questions, but the java tutorial doesnt cover this
THANKS for any guidance.
I am working with dynamic objects in my program.
Very simple,
A Vector is hosting all objects created and with a for loop I go through all of them one at a time calling their methods and changing their behavior.
So far so good.
However, After I have like 100 Objects in there, the loop is big and the single thread gets slow (the animations are on/off the objects perform on screen) so I thought "There must be a way to spawn another thread? or one thread for every 5 of them?".
And if I can do that and create threads, then I can put a thread inside the super class so all subclass (objects) inherit the code from it and perform everything on their own thread?
Lots of questions, but the java tutorial doesnt cover this

THANKS for any guidance.