Game Development Community

Controlling multiple sprites simultaneously

by Ty Newton · in Torque X 2D · 04/17/2008 (2:55 am) · 0 replies

Hi,
I was wondering if this is a reasonable solution to the problem I have or if there is some other, perhaps better, way anyone can suggest.

I want to move multiple sprites on the screen based on the user action i.e. pressing the right digital button.

I tried creating all the sprites and hooking them all up to the my own slightly modified MovementComponent (from the starter project). As I expected only one of the sprites moved. It seems that events can't cascade to multiple objects. I'll have to double check in the source code to be sure, but I havn't had a chance yet.

I am thinking of creating a class that my sprites register with. That class does the processing contained in the MovementComponent. It could either move the sprites itself or pass a move event to the sprites and then they move themselves.

Is there a more TorqueX'ish way of doing this?


Thanks,
T