Keeping drawn weapon object in same relative position to airborne character?

gw4

Member
For my weapon code system, I'm using the following style of code to draw the melee weapon (based on the weapon sprite), continue drawing it in a brief swinging sequence, and then it is destroyed:

draw_sprite_pos(sprite, subimg, x1, y1, x2, y2, x3, y3, x4, y4, alpha)

It looks clean when the character is standing still, but when jumping the weapon stays in the spot where the attack button was pressed and the character keeps going. Using this style of code, what can I plug in so it doesn't look like the character is arbitrarily summoning sword swings in the air? (haha)

thanks for your time!
 

Nidoking

Member
To make one instance follow another, you set the x and y based on the other instance's x and y. If you've got more xs and ys than just the one, you need to update them all accordingly.
 

gw4

Member
To make one instance follow another, you set the x and y based on the other instance's x and y. If you've got more xs and ys than just the one, you need to update them all accordingly.
Thanks for the tip, Nidoking! Got it figured out!
 
Top