Armor system;many sprites

Smenkare

Member
Hi, my character has 6 sections : feet, legs, body, head, shield, sword. I have animted sprites for each section for each item (theres many items in game). My question is: what is the most efficent way to make it. Should i make 6 objects and check which item is currently on my character, then change sprites, animation etc. or is there easier and better way to do it?
 

YoSniper

Member
You can have one object, if that makes it simpler.

However, you would have to keep track of the image index of each sprite you intend to use (create variables in the object's Create Event for this) as the image_speed and sprite_index attributes will only pertain to the one sprite assigned to the object.

In addition, in the Draw Event of said object, you would have to draw each sprite at the appropriate index, in order from deepest to foremost.

The other way to do this would be to create 6 different objects that you would likely have to link together. I do not recommend this approach unless you have to work with specific collision masks for each part of the body.
 
Top