diff options
author | Starla Insigna <starla4444@gmail.com> | 2013-01-02 23:27:26 -0500 |
---|---|---|
committer | Starla Insigna <starla4444@gmail.com> | 2013-01-02 23:27:26 -0500 |
commit | ba19dd3f2517a95e09dcfe288a781c6f335b5e81 (patch) | |
tree | 681e43be807ed46b75dab6b291a6a6dd3e67b6e5 /Classes/Cart.m | |
parent | 28497668761472e085d0c9955aa8077d11bf353c (diff) | |
parent | f82fdb7134632c1a52902d44c0d555dac0225898 (diff) | |
download | cartcollect-ba19dd3f2517a95e09dcfe288a781c6f335b5e81.tar.gz cartcollect-ba19dd3f2517a95e09dcfe288a781c6f335b5e81.tar.bz2 cartcollect-ba19dd3f2517a95e09dcfe288a781c6f335b5e81.zip |
Pulled in trunk changes because the iOS 6 bug was making it impossible to test
Diffstat (limited to 'Classes/Cart.m')
-rw-r--r-- | Classes/Cart.m | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/Classes/Cart.m b/Classes/Cart.m index 0344bdf..f9da181 100644 --- a/Classes/Cart.m +++ b/Classes/Cart.m | |||
@@ -54,7 +54,7 @@ | |||
54 | if ((delegate != nil) && ([delegate respondsToSelector:@selector(cartShouldFall:)])) | 54 | if ((delegate != nil) && ([delegate respondsToSelector:@selector(cartShouldFall:)])) |
55 | { | 55 | { |
56 | int bottom = [delegate cartShouldFall:self]; | 56 | int bottom = [delegate cartShouldFall:self]; |
57 | sprite.position = ccp(sprite.position.x, MAX(bottom, sprite.position.y-6)); | 57 | sprite.position = ccp(sprite.position.x, MAX(bottom, sprite.position.y-8)); |
58 | } else { | 58 | } else { |
59 | NSLog(@"Falling is set on a cart without a compatible game mode."); | 59 | NSLog(@"Falling is set on a cart without a compatible game mode."); |
60 | } | 60 | } |
@@ -62,15 +62,14 @@ | |||
62 | } | 62 | } |
63 | } | 63 | } |
64 | 64 | ||
65 | - (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration | 65 | #define kFilterFactor 0.05f |
66 | |||
67 | - (void)deviceDidRotate:(double)pitch | ||
66 | { | 68 | { |
67 | static float prevY=0; | 69 | static float prevY=0; |
68 | 70 | float accelY = -((float) pitch * kFilterFactor + (1- kFilterFactor)*prevY); | |
69 | #define kFilterFactor 0.05f | 71 | |
70 | 72 | prevY = accelY; | |
71 | float accelY = -((float) acceleration.y * kFilterFactor + (1- kFilterFactor)*prevY); | ||
72 | |||
73 | prevY = accelY; | ||
74 | accelX = accelY * 750; | 73 | accelX = accelY * 750; |
75 | } | 74 | } |
76 | 75 | ||