I am new to swift and just started learning recently.
currently I am having trouble with spawning random objects. One is top and the other is bottom and I want to choose between the two randomly and continue to repeat that action.
What I have so far is I can get the objects to scroll continuously from right to left and then go off the screen. But with my code it will either spawn the top or the bottom object and then never the other one. It will repeat spawning the one it choses first.
Not sure if I need to move it from the didMove(to view: Skview) function to another one or if there is a better way to code this.
Below is the code I used to try and get it to repeat both of them one by one continuously.
This is in the override func didMove(to view: SKView).
Aucun commentaire:
Enregistrer un commentaire