I suppose this isn't necessarily UnDelphiX specific, but it's not even programming specific as it involves pure math basically but yeah lol.

Anyway, basically I have a player sprite and then I have his attacking sprite, there seperated for collisions and such.

Basically when he needs to attack, I create the attack sprite, animate, then kill it.

But I'm having a bit of trouble aligning the attack sprite with the player sprite properly.

There are 4 attack animations, depending on which way the player sprite is facing (which I keep track of through input movement), Up, Down, Left and Right.

Depending on which facing, most of the trouble comes from centering the attack sprite to the player sprite.

For example, if a user has the player facing Left and hits the spacebar, it will start the attack sprite attached to the left side of the player sprite.

In which case the attack sprite should be positioned, as perfectly center, concerning the player's Top (Y) co-ordinate.

For now, I use something like this (Handles UP FACING position):

[pascal]X := TPlayer(Player).X - (TPlayer(Player).Width Div 2) + 3[/pascal]

But even then it's not really dead on.

And as unfortunate as I think it is, this will have to change for each direction, as sometime's it's the Y (top) position that requires centering.

I don't have much of a problem getting the attack sprite on the edge of the player sprite though, Iv'e done that sort of thing with other stuff besides games before.