Coming from a flash / actionscript / processing background I’m used to having a method I can call which I will run every frame.
No such per/frame function exist on the iphone (that I know of):
You do it using a timer, like so:
[NSTimer scheduledTimerWithTimeInterval:1.0 / 30.0 target:self selector:@selector(onTimer) userInfo:nil repeats:YES];
Place that into viewDidLoad for your .m
Then create the function to catch the loop.
- (void)onTimer {
[ball update];
}
Tags: Uncategorized