Game Development Community

Changing Animations

by Rich Hudson · in Torque X 2D · 09/18/2007 (7:20 pm) · 1 replies

Whats the best way to implement different animations depending on which way the character is facing (or depending on what they are doing). Is it best to put all animations into one sheet and reference the frames depending on which are needed, or is there a way to load different animations sheets depending on what the "player" is doing?

RH

#1
09/19/2007 (9:15 am)
You don't set an objects animation equal to a particular file, you set it equal to an animation, which may or may not use all sprites in its file. If you wanted to break up the animations by direction into different files you can but this would not give any advantage I am aware of.

If your animation for walk left, right, etc, are only one frame and you use a zero play speed, then you could change animation by just setting the frame. But if you have a normal multi-frame animation then you should define a separate animation for each direction and switch between them (Separate animations does not mean separate files--look at method for switching animations on a t2danimatedsprite and its parameters).

I suggest getting the platformer starter kit which does all of this.