Smart player positioning

Hi guys,

I have 20 PLAYER PILOTS and a PROP PLANE.

I am positioning particular PILOT in a PLANE like this:

pilot.x = plane.x - plane.width\*0.3 pilot.y = plane.y - plane.height\*0.2

I am moving whole Group (player and pilot) later on.

Now due to fact that not all pilots are the same height and width I would have to test this thoroughly… 

I want pilot to be in the plane seat.

Anybody has a nicer solution?

Pilots and plane are Sprites (animated).

Many thanks.

Ivan

What anchor points are you using? If you use say a bottomLeft arrangement, it won’t matter how wide/tall the pilot image is.

If the planes can fly both ways, you could test which way the plane is flying and set the anchor points and x value of the pilot accordingly.

Hi Nick,

I am using default anchors (0.5, 0.5).

I am using this to put pilot behind the plane.

pilot:toBack()

Plane showcase is attached.

You suggest I use?

pilot.anchorX = 0.5; pilot.anchorY = 1;

Thanks!

Ivan

What anchor points are you using? If you use say a bottomLeft arrangement, it won’t matter how wide/tall the pilot image is.

If the planes can fly both ways, you could test which way the plane is flying and set the anchor points and x value of the pilot accordingly.

Hi Nick,

I am using default anchors (0.5, 0.5).

I am using this to put pilot behind the plane.

pilot:toBack()

Plane showcase is attached.

You suggest I use?

pilot.anchorX = 0.5; pilot.anchorY = 1;

Thanks!

Ivan