Advice on a game

I抦 currently making a game where many objects (like shots and enemy ships) will be displayed on the screen at once. For each shot that is taken, I start a new Thread. When the run() method of the Thread ends, will the Thread be automatically GC抎? I don抰 want to have a ton of Thread objects floating around. Thanks for any advice.

[337 byte] By [Rob_Ha] at [2007-11-26 18:02:20]
# 1
> Thanks for any advice.You should be able to treat a Thread object as any other object with regard to GC. When the object is no longer referenced it gets GC'ed.
Rob_Ha at 2007-7-9 5:32:10 > top of Java-index,Java Essentials,Java Programming...
# 2

> I抦 currently making a game where many objects (like

> shots and enemy ships) will be displayed on the

> screen at once. For each shot that is taken, I start

> a new Thread. When the run() method of the Thread

> ends, will the Thread be automatically GC抎? I don抰

> want to have a ton of Thread objects floating around.

> Thanks for any advice.

Hmm. I don't think that its necessary for you to have a new thread for every

shot or any other object. I think that it'll be enough, if you'll have one thread

for drawing the objects on screen and one thread for handling the user's inputs.

karii-mattii

typos corrected

Message was edited by:

kari-matti

kari-mattia at 2007-7-9 5:32:10 > top of Java-index,Java Essentials,Java Programming...