ios - performSelectorinBackground in certain time -



ios - performSelectorinBackground in certain time -

i'm new ios programming , made little game.

i have sprites in background of scene want move left right. right i'm doing in mainscene:

[self performselectorinbackground:@selector(dobackgroundanimation:) withobject:sprite];

and method in animation takes place looks this:

-(void)dobackgroundanimation:(ccnode *)sprite { while (//sprite still in scene) { //move sprite little bit right } }

this solution not looking for, since time takes run through while-loop varies device device.

is there way create sure animation takes exact amount of time e.g. 5 seconds? like:

performselectorinbackground:@selector(dobackgroundanimation:) withobject:turtle intime:5.0

thank help!

it's been while since did game stuff have adjust distance move sprite according time since lastly update of screen. have var called speed * time since lastly refresh , move sprite distance.

there methods in sprite kit deal this. there lots of tutorials on youtube cover this.

ios objective-c

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -