SpriteKit Backgrounds

I want to develop a Universal Device multiple part background for a SpriteKit game. The question I have has to do with art board sizes for each. What dimension would my art boards have to be in order to work on a Universal App in landscape mode only? The ground and middle backgrounds would be limited to maybe half the screen width in either direction and off the left and right edges of the screen.

I would like the (far background) clouds to scroll all of time.

I would like the (middle background) buildings or fields /trees to move only when the player moves and more slowly than the ground under the player’s feet.
and then of course the ground that will move slightly fast than the other two backgrounds.

1 Like

There are a few ways to do this, it really depends. In either case it is called a Parallax Scroll.

In a 2D game the basic choices are between moving in one direction only or moving a camera.

In the single direction method (e.g. only scroll left) the player’s character typically doesn’t move on the X axis at all, instead you scroll the layers of the world to create an illusion of moving right (opposite direction of the scroll).

In the camera method, you are moving the camera with the player being a child of the camera (or the camera being a child of the player, it depends). In this method the layers often have the desired effect because of the zPosition and distant layers being larger than layers that are closer.

In both cases it will take some experimentation with the size of your artwork. The safe bet is to make your assets fit the screen for each device type and put them in the Asset Catalog so devices only get the assets they need.

Thank you very much for the explanation! I am new to programming and am trying to learn Swift. Do you know of links that would help me with this?

This article was written for Cocos2d V3 in Objective-C but the concepts are mostly transferable to SpriteKit easily (SpriteKit is “inspired” by Cocos2D). SpriteKit has an SKCameraNode that works really well, I’m almost done with a tutorial for my personal blog on using it actually.

http://www.learn-cocos2d.com/2012/12/ways-scrolling-cocos2d-explained/

For Parallax Scrolling your best bet is to just google Parallax Scrolling and read up on the ones that interest you. There are several ways to do it, but they generally either have to do with speed the layers move or scale/distance.

Please let me know when your tutorial is ready!!! I will do some searching and Thank you again! I really appreciate your assistance!

Hi,

Try to visit this list of backgrounds. https://mobilegamegraphics.com/product-category/all_products/backgrounds/ I already bought of their very nice backgrounds.

Try this site, https://mobilegamegraphics.com i bought some very nice spritekit from them and they also have a free stuff.