I have a SpriteKit game with a ball that can be thrown and dragged. When it is thrown, the SKCamera follows it. What I want is shown in the picture below:
How can I build this kind of obstacle?
I have a SpriteKit game with a ball that can be thrown and dragged. When it is thrown, the SKCamera follows it. What I want is shown in the picture below:
How can I build this kind of obstacle?
Copyright © 2021 Jogjafile Inc.
One approach could be that you create a function that adds SKShapeNode which is your obstacle. You could keep list of your obstacle with an array where you append all your obstacles and remove first obstacle every time it disappears from view. That way your node count will stay low and you can have an infinite amount of obstacles.
Here is a sample code which creates new obstacles when player pass the most right obstacle in the game world.