d3d_transform_set_rotation_z(image_angle) d3d_transform_add_translation(x,y,0) draw_sprite_ext(backleg_sprite, 0, 0, 0, image_xscale, image_yscale, 0, image_blend, image_alpha); draw_sprite_ext(frontleg_sprite, 0, 0, 0, image_xscale, image_yscale, 0, image_blend, image_alpha);
But how can I do this same thing IF I have multiple sprites that ARE ROTATED AT DIFFERENT ANGLES (unlike the above two which both rotate with image angle). Here is my code thus far:
//DRAW EVENT
d3d_transform_set_rotation_z(0)
d3d_transform_add_translation(x,y,0)
draw_sprite_ext(aluwolf_sword, 0, 0, 0, alucard.image_xscale, alucard.image_yscale, wolf_body1_angle, image_blend, image_alpha);
draw_sprite_ext(aluwolf_body2, 0, 0, 0, alucard.image_xscale, alucard.image_yscale, wolf_body2_angle, image_blend, image_alpha);
draw_sprite_ext(aluwolf_body1, 0, 0, 0, alucard.image_xscale, alucard.image_yscale, wolf_body1_angle, image_blend, image_alpha);
//Next two don't rotate
draw_sprite_ext(aluwolf_head, head_index, 0, 0, alucard.image_xscale, alucard.image_yscale, 0, image_blend, image_alpha);
draw_sprite_ext(backleg_sprite, floor(image_index), 0, 0, alucard.image_xscale, alucard.image_yscale, 0, image_blend, image_alpha);
d3d_transform_set_identity();
I have it coded so that when I walk downhill the body pieces and sword angle downward. And when I walk uphill they all angle upward. Now this code actually does work when I walk downhill, but when walking uphill for some reason the pieces appear to move back instead of rotating in place? Why is this? And how can I adapt my code to take the fact that these sprites use 2 angles instead of one into account?
I will gladly rep anyone who solves this. I have messed with my code for about 2-3 hours trying to figure out how to fix this issue and could not. This is also my first time creating an object that uses multiple rotating sprites for it, so any good advice on working with them is welcome.
Edited by esco, 22 May 2012 - 12:50 AM.











