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

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

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

asp.net mvc - breakpoint on javascript in CSHTML? -