Nested containers (moving and rotating sprites)

Hi, first time poster here. :wave:

I come from a Unity background and I am very excited to work with Phaser. However one thing stumps me. I understand nested containers are not possible. This means I probably have to start thinking way differently. I was hoping someone here could help me start thinking in the right direction.

I want to make a simple side scrolling game where the player controls a forklift. Besides moving left and right, the player should be able to tilt the mast back and forth and move the fork carriage up and down. Now, conceptually I would do the following:

image

I would make one super object that contains the whole forklift (the red box). This I can use for lateral movement. Then inside that I would make one object with the mast (the gold box). This I would give a pivot point near the bottom and it would allow the player to tilt the mast. Inside this object I would place the fork carriage that the player can move up and down.

But if I cant nest these objects, how the hell am I going to allow for this type of behaviour? It would require some pretty complicated math to keep track of where everything is…

:wave: Nested containers are still supported, AFAIK.

I read here they will be removed https://github.com/photonstorm/phaser/issues/3852

I would hate to build my whole game upon tech that will be deprecated at some point in the near future…

I would hate to build my whole game upon tech that will be deprecated at some point in the near future…

I think it wont be removed. But in the worst case, you can move over to PixiJS :wink: