summary refs log tree commit diff stats
path: root/Classes/Cart.m
diff options
context:
space:
mode:
authorStarla Insigna <starla4444@gmail.com>2011-08-12 09:51:50 -0400
committerStarla Insigna <starla4444@gmail.com>2011-08-12 09:51:50 -0400
commitd19677f9f73d8fe7436982bdf8d40f69d69d1b43 (patch)
tree74853f369ef51bc9f9f595ff31153ce1a718e651 /Classes/Cart.m
parent07f40d804de35d1cead13217c448811e774e6e67 (diff)
downloadcartcollect-d19677f9f73d8fe7436982bdf8d40f69d69d1b43.tar.gz
cartcollect-d19677f9f73d8fe7436982bdf8d40f69d69d1b43.tar.bz2
cartcollect-d19677f9f73d8fe7436982bdf8d40f69d69d1b43.zip
Added tutorial mode
GameLayer was also renamed to ClassicGameMode and its pause functionality and score/lives counters were moved out to GameMode. FallingObjectDelegate was created to allow for custom code to be run when items were caught/missed, something that is used extensively by tutorial mode.

Important: Cart Collect's bundle identifier was changed in this revision from com.fourisland.Cart-Collect to com.apatheticink.Cart-Collect, so ensure that before attempting to compile/run this build, you clear your build directory and remove the old version of Cart Collect from your device.

Closes #193
Diffstat (limited to 'Classes/Cart.m')
-rw-r--r--Classes/Cart.m10
1 files changed, 7 insertions, 3 deletions
diff --git a/Classes/Cart.m b/Classes/Cart.m index 3046be3..45c370c 100644 --- a/Classes/Cart.m +++ b/Classes/Cart.m
@@ -10,7 +10,7 @@
10 10
11@implementation Cart 11@implementation Cart
12 12
13@synthesize sprite; 13@synthesize sprite, immobile;
14 14
15- (id)initWithSprite:(CCSprite*)m_sprite 15- (id)initWithSprite:(CCSprite*)m_sprite
16{ 16{
@@ -19,6 +19,7 @@
19 if (nil != self) 19 if (nil != self)
20 { 20 {
21 sprite = m_sprite; 21 sprite = m_sprite;
22 immobile = NO;
22 } 23 }
23 24
24 return self; 25 return self;
@@ -26,8 +27,11 @@
26 27
27- (void)tick 28- (void)tick
28{ 29{
29 // Move the cart based on acceleration gathered from accelerometer 30 if (!immobile)
30 sprite.position = ccp(MIN(MAX(sprite.position.x+accelX, 16),464), sprite.position.y); 31 {
32 // Move the cart based on acceleration gathered from accelerometer
33 sprite.position = ccp(MIN(MAX(sprite.position.x+accelX, 16),464), sprite.position.y);
34 }
31} 35}
32 36
33- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration 37- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration