-
I'm trying to implement parallax scrolling with multi-layer support, where each layer uses Box2D for collision detection and physics. I know how to separate collision detection between layers (using masks), but I’m unsure about handling movement and scaling. Objects on layers further from the camera should move more slowly and appear smaller. How can I make Box2D account for this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I would use a larger visual viewport for the layers further back. Make it a rendering problem. Also you might consider using a separate Box2D world for each layer instead of using masks. |
Beta Was this translation helpful? Give feedback.
I would use a larger visual viewport for the layers further back. Make it a rendering problem. Also you might consider using a separate Box2D world for each layer instead of using masks.