swift - SKAction repeated forever -


how can limit number of time skaction running?

if pointslabel.number > highscorelabel.number{             runaction(bestscore)          highscorelabel.setto(pointslabel.number)          let defaults = nsuserdefaults.standarduserdefaults()         defaults.setinteger(highscorelabel.number, forkey: "highscore")          } 

and

var bestscore = skaction.playsoundfilenamed("1up", waitforcompletion: false) 

help me please

to repeat action number of times, rather repeating forever, can use + repeataction:count: method. docs:

creates action repeats action specified number of times. when action executes, associated action runs completion , repeats, until count reached.this action reversible; creates new action reverse of specified action , repeats same number of times.

important thing keep in mind action repeated must have non-instantaneous duration.


Comments

Popular posts from this blog

php - Passing multiple values in a url using checkbox -

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -