I have a large object and a small object - the small object updates its x
and y
position every step to match the x
and y
of the larger object. It is easy to keep it in the same position on the larger object without any rotation, as follows (in this instance, slightly above and to the right of the centre of the larger object, here called Owner
:
x = Owner.x + 50
y = Owner.y - 50
However, this all goes pearshaped if the larger object is rotated from its sprite's initial position!
How can I maintain the relative position of the two objects even when rotated?