I am having a slight issue, not sure if its me or sprite-kit, but, I am trying to add an endless background type of side-scroller into my new game.
The problem is, I started with a single view application and then imported sprite-kit to use its features, however whenever I use sprite-kit, the perfectly synced game becomes broken, by the way, to display
the timers: the issue code:
in .H:
NSTimer * tubes2;
and in .M: in a method that is called when screen is tapped:
tubes2 = [NSTimer scheduledTimerWithTimeInterval:0.0f target:self selector:@selector(tubeMove) userInfo:nil repeats:YES];
and is then invalidated once the action is complete, dont worry it cant be repeated since i put a hold until its complete only then is it used with an
isValid
statement and a bool.
I found out that this is indeed an issue on sprite-kits side, the timers are simply un-synced, too bad I wont be able to use it. Hopefully apple will fix the issue in the near future, and thanks all for your help!
Also this could be solution:
You should not be using NSTimer with an delay of 0 and repeats YES. you should also not be using NSTimer at all for moving things in sprite kit. There are timers that are built in Sprite kit that should be using for doing things in Sprite kit.