diference between positions of characters

Started by Gepard, Thu 03/12/2009 11:11:41

Previous topic - Next topic

Gepard

Is there a way I can find out the difference between the position.x of player character and some other character and possibly store this result as an int?

Thanks!
Drink up me 'arties! Yo ho!

Khris

int x_diff = player.x - cOtherguy.x;

If the result needs to be positive, add

if (x_diff < 0) x_diff = -x_diff;

SMF spam blocked by CleanTalk