Game Development Community

Moving multiple sprites simultaneously

by Ty Newton · in Torque X 2D · 04/17/2008 (3:04 am) · 1 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 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

#1
02/28/2009 (2:12 am)
Hi Ty

Have you managed to have any luck getting multiple objects moving around screen?

I am having the same problem, I want two object to move around from input from a single gamepad controller.

Any idea's?