GregDev Posted January 10, 2018 Share Posted January 10, 2018 (edited) Hi guys, I'm new to the framework but I googled around abit and couldn't find an answer to this: I’m making a tile mapped game where the player needs to make their way through a tiled level by moving upwards. To achieve this the camera follows the player around a rectangular world My question is about creating 2 background TileSprites that scroll with the camera BUT not at the same speed as the camera to achieve the effect of having a background with TileSprite 1 in the distance and TileSprite 2 in the far distance Maybe something like an event handler that works like this: onCameraPositionChange(yDistance){ backgroundTileSprite1.scrollY -= yDistance/2 backgroundTileSprite2.scrollY -= yDistance/4 } Right now my setup is like this: TileSprite 1 -> moves with the camera TileSprite 2 -> stays still in background using TileSprite.fixedToCamera It looks okay right now, but I think this would convey a more convincing sense of distance. Cheers and thank you! Edited January 11, 2018 by GregDev Link to comment Share on other sites More sharing options...
Recommended Posts