Game Development Community

Switching sprite frames and working with templates

by Arden · in Torque X 2D · 01/08/2011 (12:00 am) · 2 replies

Hiya all,

This will seem quite basic I guess to some of you, but I'm wondering what is the best way to switch between 3 sprite images representing a building being progressively destroyed by projectiles. Can I:

- Work from a StaticSprite template and trigger frame switching through code?
- Work from an AnimatedSprite template and triggerer single animation frames through code?

How do you guys handle it with situations where you have a lot of destructible objects? Can we use templates for that, or do we absolutely have to work from individual sprites and manually switch the materials?

Any help appreciated,
Thx

#1
01/08/2011 (5:00 am)
I always go through the animated sprite option for switching images. Best reason is it looks nicer in the editor... For this type of sprite, I also always set the FPS to 1 second per, which eliminates an occasion where the wrong frame is assigned, with the setFrame function, which happens quite often on some strips, depending on the length.
#2
01/08/2011 (4:02 pm)
Great. Thanks Will. Makes sense. Happy new year!