/// Events ///
- (void) touchesBegan:(NSSet*)touches withEvent:(UIEvent*)event {
- panning = false;
+ _panning = false;
for (UITouch *touch in touches) {
CGPoint touchLocation = [touch locationInView:self];
CGPoint worldPosition = [self screenSpaceToWorldSpace:touchLocation];
CGPoint screenDistanceMoved = CGPointMake(touchLocation.x-lastScreenTouch.x,touchLocation.y-lastScreenTouch.y);
- if (panning) {
+ if (_panning) {
screenDistanceMoved.x /= 160;
screenDistanceMoved.y /= 160;
screenDistanceMoved.x *= sceneScale;
- (void) accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration {
// Only run for valid values
if (acceleration.y != 0 && acceleration.x != 0) {
- if (self.world) [self.world setGravityX:acceleration.x Y:acceleration.y];
+ if (self.world) [self.world setGravityX:acceleration.x y:acceleration.y];
}
}