ios - SKAction: scaleTo:1.0 duration .01, is there a way to make "duration" any faster/instant? Objective C, Sprite Kit -
i trying duration of skaction down pretty nothing. reason action subtracts users coins, , though .01 pretty fast, still not instant , user cannot make move while coins subtracting. there anyways "instantly" perform skaction?
nslog(@"subtractusercoinsactivated"); int = user_coins; int result = - 49; [self setuserinteractionenabled:false]; __block int dummyscore = a; skaction* scaleup = [skaction scaleto:1.0 duration:0.01]; skaction* block = [skaction runblock:^{ dummyscore--; _usercoinstext.text = [nsstring stringwithformat:@"%i",dummyscore]; if(dummyscore == result) { [_defaults setinteger:result forkey:@"usercoins"]; [_defaults synchronize]; nslog(@"-49 coins"); [self setuserinteractionenabled:true];
if want instant skaction, set duration 0.0 instead of 0.01 .
i time. program in swift, should same in objective-c
e.g. in code right have scale action uses duration of zero
let scale:skaction = skaction.scaleto(0, duration: 0.0)
Comments
Post a Comment