Maintain sprite x co-ordinates dynamically from central sprite on all screen sizes

I am having difficulty taming a sprite on my scene (SpriteKit) so that it computationally positions itself well on all screen sizes. The issue being that I am looking to twin a sprite on both of its left and right respective sides so that I can set the CGPoint of the central sprite and the other two dynamically adjust (the heigh value is constant and not an issue):

anchorPoint = CGPoint(x: 0.5, y: 0.5) //center of scene
let centerSpritePositionWidth: CGFloat = ScreenSize.width * -0.01 //edge of screen bounds : +/- 0.50
let centerSpritePositionHeight: CGFloat = ScreenSize.height * -0.08 //edge of screen bounds : +/- 0.50

centerSprite.position = CGPoint(x: centerSpritePositionWidth, y: centerSpritePositionHeight)
leftSprite.position = CGPoint(x: centerSpritePositionWidth + (centerSpritePositionWidth * 7), y: centerSpritePositionHeight)
rightSprite.position = CGPoint(x: centerSpritePositionWidth - (centerSpritePositionWidth * 7), y: centerSpritePositionHeight)
Terms of Service

Privacy Policy

Cookie Policy