我该如何控制我的玩家速度?我正在使用didSimulatePhysics()
方法进行移动:
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)];
但是这种方法取决于设备性能,当我在iOS设备上运行我的应用程序时,速度非常不稳定,有时会非常快,有时会变慢,我该如何控制这个速度?