ios - How to make changes to SKActions periodically? -


i want change speedofrectangle after spawning few rectangles(skshapenodes).

func wait(factor: cgfloat = 1) -> skaction {     return skaction.waitforduration(nstimeinterval(rectheight * speedofrectangle * distancebetweenrectangles / factor)) }  let spawnsequence = skaction.sequence([wait(), increasecounter, spawnaction]) let spawnsequenceforever = skaction.repeatactionforever(spawnsequence)  worldnode.runaction(spawnsequenceforever) 

how make changes skactions periodically?

the easiest way change action remove old action , create new one. can remove actions removing "key" or remove actions running on node removeallactions().

changing actions while running has no effect until action completed , run again.

hope helped , luck.


Comments

Popular posts from this blog

swift - Button on Table View Cell connected to local function -

dns - Dokku server hosts two sites with TLD's, both domains are landing on only one app -

c# - ajax - How to receive data both html and json from server? -