We need to create a road for our rabbit to run on and also for it to find the exit of the top hat. In this case, we will follow almost the same steps than we did to add the rabbit, but with a few differences.
Add the background image in a way that is similar to how we added the rabbit's image:
background.pngfile in the
7338_01_Resourcesfolder that you unzipped. Select it and click on Add.
Then, add the following lines to
GameScene before the
// Creating and adding the background to the scene let background = SKSpriteNode(imageNamed: «background») background.anchorPoint = .zero addChild(background) ...