How can I control the speed of my player? I use the method didSimulatePhysics()to move:
if(([self childNodeWithName:@"hero"].position.x >= 180)
&&
(self.touchedHero == YES)
&& _canMove ==YES){
[[self childNodeWithName:@"hero"]setPosition:CGPointMake(180, [self childNodeWithName:@"hero"].position.y)];
[self.world setPosition:CGPointMake(self.world.position.x-5, self.world.position.y)];
But this method depends on the performance of the device, and when I launch my application on the iOs device, the speed is very unstable, sometimes it goes very fast and sometimes it slows down, how can I control this speed ???
source
share