Home Spawning Sprite problems in swift3 xCode
Reply: 1

Spawning Sprite problems in swift3 xCode

LukeTerzich Published in 2017-09-13 16:08:52Z

Im having some issues, I have sprites spawn on the right of the screen and work there way left then when they go off the screen they are removed from the scene and the process restarts. I want every spawn to get quicker by like 0.1seconds.

Problem is i am calling my spawn function when the game starts and its on a constant loop so i cant then update the delay.

Spawn Code:

    func spawnBirdRL() {                                                    
    let spawn = SKAction.run({ () -> Void in
    let delay = SKAction.wait(forDuration: (TimeInterval(spawnDuration)))
    let sequence = SKAction.sequence([spawn, delay])

    self.run(SKAction.repeatForever(sequence), withKey: "Spawn")

Which is being called in the TouchesBegan function.

It creates the enemy bird and runs the movement loop over and over

LukeTerzich Reply to 2017-09-14 14:31:53Z

I have changed the question slightly with more information...

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.544711 second(s) , Gzip On .

© 2016 Powered by cudou.com design MATCHINFO