From 60d01ef24806e47b38b80e5df892a49aaae8a6cc Mon Sep 17 00:00:00 2001 From: dsc Date: Tue, 24 May 2011 13:01:03 -0700 Subject: [PATCH] Proof of concept -- tank fires bullet, bullet interacts with other physical objects. --- libs/sparrow/src/Extras/BEParallaxSprite.h | 1 + libs/sparrow/src/Extras/BEParallaxSprite.m | 6 +- libs/sparrow/src/Extras/SparrowExtras.h | 2 +- src/Tanks.h | 2 + src/TanksMacros.h | 7 ++ src/game/QQActive.h | 1 + src/game/QQDisplayable.h | 8 ++- src/game/QQGame.h | 7 +- src/game/QQGame.mm | 22 ++++++-- src/game/QQPhysical.h | 12 +++- src/game/ability/QQCooldown.h | 4 +- src/game/ability/QQCooldown.mm | 2 +- src/game/actor/QQActor.h | 4 + src/game/actor/QQActor.mm | 51 +++++++++++++++- src/game/actor/QQActorDelegate.h | 6 ++ src/game/actor/QQIUnit.h | 16 +++++ src/game/actor/QQUnit.h | 25 +++++++-- src/game/actor/QQUnit.mm | 76 ++++++++++++++++++++++++ src/game/actor/QQUnitBase.h | 30 ---------- src/game/actor/QQUnitBase.mm | 86 ---------------------------- src/game/actor/QQUnitDelegate.h | 6 -- src/game/actor/bullet/QQBullet.h | 10 ++-- src/game/actor/bullet/QQBullet.mm | 28 +++++++-- src/game/actor/unit/QQTank.h | 9 ++- src/game/actor/unit/QQTank.mm | 38 ++++++++++-- src/main.mm | 1 + src/physics/QQPhysics.h | 4 + src/physics/QQPoint.h | 6 ++ src/physics/QQPoint.mm | 12 ++++ src/physics/QQWorld.mm | 11 ++-- src/qq/QQNotifier.h | 15 +++++ src/qq/QQObject.h | 10 +++ src/qq/QQObject.mm | 12 ++++ src/qq/QQObservable.h | 16 +++++ src/render/QQSparrowExtensions.h | 14 +++++ src/render/QQSparrowExtensions.mm | 27 ++++++++- tanks.xcodeproj/project.pbxproj | 73 ++++++++++++++++++++---- 37 files changed, 471 insertions(+), 189 deletions(-) create mode 100644 src/Tanks.h create mode 100644 src/TanksMacros.h create mode 100644 src/game/ability/QQAbility.h create mode 100644 src/game/ability/QQAbility.mm create mode 100644 src/game/ability/QQStat.h create mode 100644 src/game/ability/QQStat.mm create mode 100644 src/game/actor/QQActorDelegate.h create mode 100644 src/game/actor/QQIUnit.h create mode 100644 src/game/actor/QQUnit.mm delete mode 100644 src/game/actor/QQUnitBase.h delete mode 100644 src/game/actor/QQUnitBase.mm delete mode 100644 src/game/actor/QQUnitDelegate.h create mode 100644 src/physics/QQPhysics.h create mode 100644 src/physics/QQPoint.h create mode 100644 src/physics/QQPoint.mm create mode 100644 src/qq/QQNotifier.h create mode 100644 src/qq/QQObject.h create mode 100644 src/qq/QQObject.mm create mode 100644 src/qq/QQObservable.h diff --git a/libs/sparrow/src/Extras/BEParallaxSprite.h b/libs/sparrow/src/Extras/BEParallaxSprite.h index b25c72d..3a0ec1a 100644 --- a/libs/sparrow/src/Extras/BEParallaxSprite.h +++ b/libs/sparrow/src/Extras/BEParallaxSprite.h @@ -6,6 +6,7 @@ // #import +#import "Sparrow.h" #define BE_PARALLAX_DIRECTION_LEFT 1 #define BE_PARALLAX_DIRECTION_RIGHT 2 diff --git a/libs/sparrow/src/Extras/BEParallaxSprite.m b/libs/sparrow/src/Extras/BEParallaxSprite.m index 7c01729..6e4995c 100644 --- a/libs/sparrow/src/Extras/BEParallaxSprite.m +++ b/libs/sparrow/src/Extras/BEParallaxSprite.m @@ -13,21 +13,21 @@ @synthesize running = mRunning; - (id)initWithTexture:(SPTexture *)texture { - if (self = [super init]) { + if ((self = [super init])) { [self initWithTexture:texture speed:1 direction:BE_PARALLAX_DIRECTION_LEFT]; } return self; } - (id)initWithTexture:(SPTexture *)texture speed:(float)speed { - if (self = [super init]) { + if ((self = [super init])) { [self initWithTexture:texture speed:speed direction:BE_PARALLAX_DIRECTION_LEFT]; } return self; } - (id)initWithTexture:(SPTexture *)texture speed:(float)speed direction:(int)direction { - if (self = [super init]) { + if ((self = [super init])) { mRunning = YES; mDirection = direction; if (direction < 1 || direction > 4) { diff --git a/libs/sparrow/src/Extras/SparrowExtras.h b/libs/sparrow/src/Extras/SparrowExtras.h index a597333..a53eaab 100644 --- a/libs/sparrow/src/Extras/SparrowExtras.h +++ b/libs/sparrow/src/Extras/SparrowExtras.h @@ -3,6 +3,6 @@ #import "SHCircle.h" #import "SHLine.h" #import "SHPolygon.h" -#import "BEParallaxSprite.h" +//import "BEParallaxSprite.h" #import "SXFPSMeter.h" diff --git a/src/Tanks.h b/src/Tanks.h new file mode 100644 index 0000000..5234a2e --- /dev/null +++ b/src/Tanks.h @@ -0,0 +1,2 @@ + +#import "render/QQSparrowExtensions.h" diff --git a/src/TanksMacros.h b/src/TanksMacros.h new file mode 100644 index 0000000..2a9ef11 --- /dev/null +++ b/src/TanksMacros.h @@ -0,0 +1,7 @@ +#ifndef TANKS_MACROS_H +#define TANKS_MACROS_H + + + + +#endif \ No newline at end of file diff --git a/src/game/QQActive.h b/src/game/QQActive.h index ec6fe08..9335dab 100644 --- a/src/game/QQActive.h +++ b/src/game/QQActive.h @@ -7,6 +7,7 @@ @property (nonatomic, getter=isActive) BOOL active; +- (void) tick:(float)elapsed; - (void) act; @end \ No newline at end of file diff --git a/src/game/QQDisplayable.h b/src/game/QQDisplayable.h index a559892..ab60dbf 100644 --- a/src/game/QQDisplayable.h +++ b/src/game/QQDisplayable.h @@ -6,7 +6,13 @@ */ @protocol QQDisplayable -@property (nonatomic, retain, readonly) SPDisplayObject* shape; +@property (nonatomic, readwrite, assign, getter=isDirty) BOOL dirty; // TODO: implement this and fix various [shape setPosition] calls +@property (nonatomic, readwrite, retain) SPDisplayObject* shape; + +/** + * Called to setup the Sparrow shape. + */ +- (SPDisplayObject*) setupShape; /** * Called to update appearance after game actions have occurred diff --git a/src/game/QQGame.h b/src/game/QQGame.h index 98e4cc4..835b132 100644 --- a/src/game/QQGame.h +++ b/src/game/QQGame.h @@ -1,7 +1,7 @@ #import "Sparrow.h" -#import "game/actor/QQUnit.h" #import "physics/QQWorld.h" +#import "game/actor/QQActor.h" @interface QQGame : SPStage { @@ -16,16 +16,15 @@ NSMutableSet* _bullets; } +@property (nonatomic, assign, readonly) long ticks; + @property (nonatomic, retain) QQWorld* world; @property (nonatomic, retain) NSSet* actors; -@property (nonatomic, assign, readonly) long ticks; - (QQGame*) addActor:(QQActor*)actor; - (QQGame*) removeActor:(QQActor*)actor; -- (void) onEnterFrame:(SPEnterFrameEvent*)event; - + (QQGame*) current; @end diff --git a/src/game/QQGame.mm b/src/game/QQGame.mm index 512e165..51b05b4 100644 --- a/src/game/QQGame.mm +++ b/src/game/QQGame.mm @@ -1,5 +1,6 @@ #import "QQGame.h" #import "game/actor/unit/QQTank.h" +#import @@ -8,6 +9,7 @@ static QQGame* _CurrentGame = NULL; @interface QQGame () +- (void) onEnterFrame:(SPEnterFrameEvent*)event; @end @@ -21,16 +23,20 @@ static QQGame* _CurrentGame = NULL; - (id) init { if (_CurrentGame) { [self release]; - [NSException raise:@"TooManyGames" format:@"cannot instantiate more than one QQGame at a time!"]; + #ifdef DEBUG + [NSException raise:@"TooManyGames" format:@"cannot instantiate more than one QQGame at a time!"]; + #else + return _CurrentGame; + #endif } if ( (self = [super init]) ){ _CurrentGame = self; - _ticks = 0l; + _ticks = 0; _actors = [[NSMutableArray alloc] initWithCapacity:10]; _world = [[QQWorld alloc] init]; - [self addActor:[[[QQTank alloc] init] autorelease]]; + [[[QQTank alloc] init] autorelease]; [self addEventListener:@selector(onEnterFrame:) atObject:self forType:SP_EVENT_TYPE_ENTER_FRAME]; } @@ -38,6 +44,7 @@ static QQGame* _CurrentGame = NULL; } - (void) dealloc { + [self removeEventListener:@selector(onEnterFrame:) atObject:self forType:SP_EVENT_TYPE_ENTER_FRAME]; [_actors removeAllObjects]; [_actors release]; [_world release]; @@ -58,10 +65,15 @@ static QQGame* _CurrentGame = NULL; - (void) onEnterFrame:(SPEnterFrameEvent*)event { _ticks++; - if ((_ticks % 100) == 0) + if ((_ticks % 100) == 0) { NSLog(@"[%ld] Time passed since last 100 frames: %f", _ticks, event.passedTime); + for (QQActor* actor in self.actors) { + b2Vec2 v = actor.body->GetLinearVelocity(); + NSLog(@"[%@ pos:(%f,%f) impulse:(%f,%f)]", actor, actor.x,actor.y, v.x,v.y); + } + } - for (QQActor* actor in self.actors) [actor act]; // XXX: self.awakeAgents + for (QQActor* actor in self.actors) [actor tick:event.passedTime]; // XXX: self.awakeAgents [self.world step]; for (QQActor* actor in self.actors) [actor draw]; // XXX: self.drawableAgents } diff --git a/src/game/QQPhysical.h b/src/game/QQPhysical.h index 0dd0ce3..ec83ded 100644 --- a/src/game/QQPhysical.h +++ b/src/game/QQPhysical.h @@ -5,13 +5,21 @@ */ @protocol QQPhysical -// @property (nonatomic, readwrite, assign) float x; -// @property (nonatomic, readwrite, assign) float y; +@property (nonatomic, readwrite, assign) float x; +@property (nonatomic, readwrite, assign) float y; +@property (nonatomic, readwrite) CGPoint position; + +- (void) setPositionX:(float)x y:(float)y; // FIXME: don't expose these, instead aggregate properties from body & fixtures/shapes @property (nonatomic, readonly) b2Body* body; @property (nonatomic, readonly) b2Fixture* fixture; +/** + * Called after initialization to create the various bodies, fixtures, and shapes + * that represent the Unit in Box2D. + */ +- (void) setupPhysics; @end \ No newline at end of file diff --git a/src/game/ability/QQAbility.h b/src/game/ability/QQAbility.h new file mode 100644 index 0000000..e69de29 diff --git a/src/game/ability/QQAbility.mm b/src/game/ability/QQAbility.mm new file mode 100644 index 0000000..e69de29 diff --git a/src/game/ability/QQCooldown.h b/src/game/ability/QQCooldown.h index f58e0a8..490a473 100644 --- a/src/game/ability/QQCooldown.h +++ b/src/game/ability/QQCooldown.h @@ -16,13 +16,13 @@ @property (nonatomic, readwrite, assign) float elapsed; /** Whether Cooldown timer is ready to be activated. */ -@property (nonatomic, readwrite, getter=isReady) BOOL ready; +@property (nonatomic, readwrite) BOOL ready; /** Percent completed (elapsed / duration), clamped [0, 1.0]. */ @property (nonatomic, readwrite) float ratio; /** - * Implies ready=NO. + * Implies ready=YES. */ - (id) initWithDuration:(float)duration; - (id) initWithDuration:(float)duration andReady:(BOOL)ready; diff --git a/src/game/ability/QQCooldown.mm b/src/game/ability/QQCooldown.mm index 9bf369a..72d9934 100644 --- a/src/game/ability/QQCooldown.mm +++ b/src/game/ability/QQCooldown.mm @@ -32,7 +32,7 @@ /// initializers - (id) initWithDuration:(float)duration { - return [self initWithDuration:duration andReady:NO]; + return [self initWithDuration:duration andReady:YES]; } - (id) initWithDuration:(float)duration andReady:(BOOL)ready { diff --git a/src/game/ability/QQStat.h b/src/game/ability/QQStat.h new file mode 100644 index 0000000..e69de29 diff --git a/src/game/ability/QQStat.mm b/src/game/ability/QQStat.mm new file mode 100644 index 0000000..e69de29 diff --git a/src/game/actor/QQActor.h b/src/game/actor/QQActor.h index 3aefbe4..c638de6 100644 --- a/src/game/actor/QQActor.h +++ b/src/game/actor/QQActor.h @@ -3,6 +3,7 @@ #import "game/QQActive.h" #import "game/QQPhysical.h" #import "game/QQDisplayable.h" +#import "game/actor/QQActorDelegate.h" #import "physics/QQWorld.h" @class QQGame; @@ -15,10 +16,13 @@ @private BOOL _active; + BOOL _dirty; + id _delegate; } @property (nonatomic, readonly) QQGame* game; @property (nonatomic, readonly) QQWorld* world; +@property (nonatomic, readwrite, retain) id delegate; - (id) initAtX:(float)x y:(float)y; - (id) initType:(b2BodyType)type atX:(float)x y:(float)y; diff --git a/src/game/actor/QQActor.mm b/src/game/actor/QQActor.mm index 03529f9..ee0876b 100644 --- a/src/game/actor/QQActor.mm +++ b/src/game/actor/QQActor.mm @@ -1,26 +1,56 @@ #import "QQActor.h" +#import "render/QQSparrowExtensions.h" #import "game/QQGame.h" @implementation QQActor -@synthesize active; +/// properties + +@synthesize active = _active; +@synthesize dirty = _dirty; +@synthesize delegate = _delegate; - (QQGame*) game { return QQGame.current; } - (QQWorld*) world { return self.game.world; } - (SPDisplayObject*) shape { return nil; } +- (void) setShape:(SPDisplayObject*)newShape {} - (b2Body*) body { return _body; } - (b2Fixture*) fixture { return nil; } +- (CGPoint) position { + b2Vec2 pos = self.body->GetPosition(); + return CGPointMake(pos.x, pos.y); +} +- (void) setPosition:(CGPoint)pos { + [self setPositionX:pos.x y:pos.y]; +} +- (void) setPositionX:(float)x y:(float)y { + self.body->SetTransform(b2Vec2(x,y), self.body->GetAngle()); + float px = self.world.scale; + [self.shape setPositionX:x*px y:y*px]; +} + +- (float) x { return self.body->GetPosition().x; } +- (void) setX:(float)x { [self setPositionX:x y:self.y]; } + +- (float) y { return self.body->GetPosition().y; } +- (void) setY:(float)y { [self setPositionX:self.x y:y]; } + + +/// initializers + - (id) initAtX:(float)x y:(float)y { return [self initType:b2_dynamicBody atX:x y:y]; } - (id) initType:(b2BodyType)type atX:(float)x y:(float)y { if ((self = [super init])) { + [self.game addActor:self]; + b2BodyDef bd; bd.type = type; bd.position = b2Vec2(x, y); @@ -30,12 +60,25 @@ return self; } -- (void) act { - // stub + +/// methods + +- (void) tick:(float)elapsed { + [self act]; +} + +- (void) act {} + +- (SPDisplayObject*) setupShape { + return self.shape; } - (void) draw { - // stub + float px = self.world.scale; + b2Vec2 pos = self.body->GetPosition(); + [self.shape setPositionX:pos.x*px y:pos.y*px]; } +- (void) setupPhysics {} + @end diff --git a/src/game/actor/QQActorDelegate.h b/src/game/actor/QQActorDelegate.h new file mode 100644 index 0000000..bae4a18 --- /dev/null +++ b/src/game/actor/QQActorDelegate.h @@ -0,0 +1,6 @@ + +@protocol QQActorDelegate + +- (void) updateWithTick:(float)time; + +@end diff --git a/src/game/actor/QQIUnit.h b/src/game/actor/QQIUnit.h new file mode 100644 index 0000000..15878ea --- /dev/null +++ b/src/game/actor/QQIUnit.h @@ -0,0 +1,16 @@ +#import "game/actor/QQActor.h" +#import "game/QQThing.h" + + +@protocol QQUnit + +@property (nonatomic, readonly) BOOL canAttack; + +- (void) attackTarget:(QQActor*)actor; +- (void) attackToward:(CGPoint)point; +- (void) attackTowardX:(float)x y:(float)y; + + +@end + +//typedef id QQUnit; diff --git a/src/game/actor/QQUnit.h b/src/game/actor/QQUnit.h index 15878ea..e1b509d 100644 --- a/src/game/actor/QQUnit.h +++ b/src/game/actor/QQUnit.h @@ -1,16 +1,31 @@ +#include +#import "Sparrow.h" + +#import "physics/QQWorld.h" #import "game/actor/QQActor.h" -#import "game/QQThing.h" +#import "game/actor/QQActorDelegate.h" +#import "render/QQSparrowExtensions.h" + +@interface QQUnit : QQActor { -@protocol QQUnit +@private + SPDisplayObject* _shape; +} +/// properties @property (nonatomic, readonly) BOOL canAttack; +- (void) setShapeFromFile:(NSString*)filename; + +/// initializers +- (id) initAtX:(float)x y:(float)y withShape:(SPDisplayObject*)shape; -- (void) attackTarget:(QQActor*)actor; + +/// methods + +- (void) attack:(QQActor*)actor; - (void) attackToward:(CGPoint)point; - (void) attackTowardX:(float)x y:(float)y; @end - -//typedef id QQUnit; diff --git a/src/game/actor/QQUnit.mm b/src/game/actor/QQUnit.mm new file mode 100644 index 0000000..1687b13 --- /dev/null +++ b/src/game/actor/QQUnit.mm @@ -0,0 +1,76 @@ +#include +#import "Sparrow.h" + +#import "QQUnit.h" +#import "render/QQSparrowExtensions.h" + + + + +@implementation QQUnit + +@dynamic world; // Eliminates compiler warnings due to inheritance (!) +@dynamic game; + +@synthesize shape = _shape; + +- (BOOL) canAttack { return NO; } + + +/// initializers + +- (id) init { + return [self initAtX:50 y:50 withShape:[SPQuad quadWithWidth:50 height:50 color:0xff0000]]; +} + +- (id) initAtX:(float)x y:(float)y withShape:(SPDisplayObject*)shape { + if ((self = [super initAtX:x y:y])) { + self.shape = shape; + + float px = self.world.scale; + b2PolygonShape box; + box.SetAsBox(shape.width/px, shape.height/px); + self.body->CreateFixture(&box, 5.0f); + } + return self; +} + +- (void) dealloc { + [self.game removeChild:_shape]; + [_shape release]; + [super dealloc]; +} + +/// methods + +- (void) setShape:(SPDisplayObject*)newShape { + if (_shape != newShape) { + [self.game removeChild:_shape]; + [_shape release]; + + _shape = [newShape retain]; + float px = self.world.scale; + [_shape setPositionX:self.x*px y:self.y*px]; + [self.game addChild:_shape]; + } +} + +- (void) setShapeFromFile:(NSString*)filename { + [self setShape:[[[SPImage alloc] autorelease] initWithContentsOfFile:filename]]; +} + + + +- (void) attack:(QQActor*)actor { + [self attackTowardX:actor.x y:actor.y]; +} +- (void) attackToward:(CGPoint)pt { + [self attackTowardX:pt.x y:pt.y]; +} +- (void) attackTowardX:(float)x y:(float)y { + +} + + + +@end diff --git a/src/game/actor/QQUnitBase.h b/src/game/actor/QQUnitBase.h deleted file mode 100644 index 6af3e83..0000000 --- a/src/game/actor/QQUnitBase.h +++ /dev/null @@ -1,30 +0,0 @@ -#include -#import "Sparrow.h" - -#import "render/QQSparrowExtensions.h" - -#import "game/actor/QQActor.h" -#import "game/actor/QQUnit.h" -#import "game/actor/QQUnitDelegate.h" - -#import "physics/QQWorld.h" - - -//////////////////////////////////////////////////////////////////////////////////// -@interface QQUnitBase : QQActor { - -@private - SPDisplayObject* _shape; - id _delegate; -} - -//////////////////////////////////////////////////////////////////////////////////// -@property (nonatomic, retain, readwrite) SPDisplayObject* shape; -@property (nonatomic, retain, readwrite) id delegate; - -//////////////////////////////////////////////////////////////////////////////////// -- (id) initAtX:(float)x y:(float)y withShape:(SPDisplayObject*)shape; - -- (void) setShapeFromFile:(NSString*)filename; - -@end diff --git a/src/game/actor/QQUnitBase.mm b/src/game/actor/QQUnitBase.mm deleted file mode 100644 index 2c52e58..0000000 --- a/src/game/actor/QQUnitBase.mm +++ /dev/null @@ -1,86 +0,0 @@ -#include -#import "Sparrow.h" -#import "QQUnit.h" -#import "QQUnitBase.h" - -// private interface -@interface QQUnitBase () - - -@end - - -//////////////////////////////////////////////////////////////////////////////////// -@implementation QQUnitBase - -@dynamic world; // Eliminates compiler warnings due to inheritance (!) -@dynamic game; - -//////////////////////////////////////////////////////////////////////////////////// -@synthesize shape = _shape; -@synthesize delegate = _delegate; - -- (BOOL) canAttack { return NO; } - - -//////////////////////////////////////////////////////////////////////////////////// -- (id) init { - return [self initAtX:15 y:15 withShape:[SPQuad quadWithWidth:50 height:50 color:0xff0000]]; -} - -- (id) initAtX:(float)x y:(float)y withShape:(SPDisplayObject*)shape { - if ((self = [super initAtX:x y:y])) { - float px = self.world.scale; - self.shape = [shape setPositionX:x*px y:y*px]; - - b2PolygonShape box; - box.SetAsBox(shape.width/px, shape.height/px); - self.body->CreateFixture(&box, 5.0f); - - [self.game addEventListener:@selector(onTouch:) atObject:self forType:SP_EVENT_TYPE_TOUCH]; - } - return self; -} - -//////////////////////////////////////////////////////////////////////////////////// -- (void) dealloc { - [self.game removeEventListener:@selector(onTouch:) atObject:self forType:SP_EVENT_TYPE_TOUCH]; - [self.game removeChild:_shape]; - [_shape release]; - [super dealloc]; -} - -//////////////////////////////////////////////////////////////////////////////////// -- (void) setShape:(SPDisplayObject*)newShape { - if (_shape != newShape) { - [self.game removeChild:_shape]; - [_shape release]; - - _shape = [newShape retain]; - // float px = self.world.scale; - // [_shape setPositionX:x*px y:y*px] - [self.game addChild:_shape]; - } -} - -- (void) setShapeFromFile:(NSString*)filename { - [self setShape:[[[SPImage alloc] autorelease] initWithContentsOfFile:filename]]; -} - - - -- (void) attackTarget:(QQActor*)actor { - -} - -- (void) attackToward:(CGPoint)pt { - [self attackTowardX:pt.x y:pt.y]; -} - -- (void) attackTowardX:(float)x y:(float)y { - -} - - - -@end diff --git a/src/game/actor/QQUnitDelegate.h b/src/game/actor/QQUnitDelegate.h deleted file mode 100644 index d52c081..0000000 --- a/src/game/actor/QQUnitDelegate.h +++ /dev/null @@ -1,6 +0,0 @@ - -@protocol QQUnitDelegate - -- (void) updateWithTick:(float)time; - -@end diff --git a/src/game/actor/bullet/QQBullet.h b/src/game/actor/bullet/QQBullet.h index e3bcfa3..6d66f6b 100644 --- a/src/game/actor/bullet/QQBullet.h +++ b/src/game/actor/bullet/QQBullet.h @@ -1,15 +1,15 @@ -#import "game/actor/QQUnitBase.h" #import "game/actor/QQUnit.h" -@interface QQBullet : QQUnitBase { +@interface QQBullet : QQUnit { @private - id* _owner; + QQUnit* _owner; } -@property (nonatomic, readonly) id* owner; +@property (nonatomic, readonly) QQUnit* owner; -- (id) initAtX:(float)x y:(float)y withOwner:(id*)owner; +- (id) init:(QQUnit*)owner x:(float)x y:(float)y; +- (void) applyLinearImpulseX:(float)xNs y:(float)yNs; @end diff --git a/src/game/actor/bullet/QQBullet.mm b/src/game/actor/bullet/QQBullet.mm index 7c489bc..3297852 100644 --- a/src/game/actor/bullet/QQBullet.mm +++ b/src/game/actor/bullet/QQBullet.mm @@ -1,22 +1,36 @@ -#import "QQBullet.h" - +#include +#import "SparrowExtras.h" -// private interface -@interface QQBullet () +#import "QQBullet.h" -@end @implementation QQBullet @synthesize owner = _owner; -- (id) initAtX:(float)x y:(float)y withOwner:(id*)owner { - if ((self = [super init])){ +- (id) init:(QQUnit*)owner x:(float)x y:(float)y { + if ((self = [super initAtX:x y:y])){ + _owner = owner; + float px = self.world.scale; + float radius = 1.5f; + self.shape = [SHCircle circleWithWidth:2*radius*px height:2*radius*px]; + + b2CircleShape circle; + circle.m_radius = radius; + b2FixtureDef fix; + fix.shape = &circle; + fix.restitution = 1.0f; + fix.density = 0.1f; + self.body->CreateFixture(&fix); } return self; } +- (void) applyLinearImpulseX:(float)xNs y:(float)yNs { + self.body->ApplyLinearImpulse(b2Vec2(xNs, yNs), self.body->GetPosition()); +} + @end diff --git a/src/game/actor/unit/QQTank.h b/src/game/actor/unit/QQTank.h index 9d58ed2..ee8c4c1 100644 --- a/src/game/actor/unit/QQTank.h +++ b/src/game/actor/unit/QQTank.h @@ -1,7 +1,10 @@ -#import "game/actor/QQUnitBase.h" +#import "game/actor/QQUnit.h" +#import "game/ability/QQCooldown.h" -@interface QQTank : QQUnitBase { - +@interface QQTank : QQUnit { + QQCooldown* _coolAtk; } +@property (nonatomic, readonly, retain) QQCooldown* coolAtk; + @end diff --git a/src/game/actor/unit/QQTank.mm b/src/game/actor/unit/QQTank.mm index f80056d..8587589 100644 --- a/src/game/actor/unit/QQTank.mm +++ b/src/game/actor/unit/QQTank.mm @@ -1,28 +1,53 @@ #import "QQTank.h" +#import "render/QQSparrowExtensions.h" +#import "game/actor/bullet/QQBullet.h" // private interface @interface QQTank () - +@property (nonatomic, readwrite, retain) QQCooldown* coolAtk; - (void) onTouch:(SPTouchEvent*)event; - @end + @implementation QQTank +@synthesize coolAtk = _coolAtk; + - (id) init { if ((self = [super init])){ - + self.coolAtk = [QQCooldown cooldownWithDuration:2]; + [self.game addEventListener:@selector(onTouch:) atObject:self forType:SP_EVENT_TYPE_TOUCH]; } return self; } +- (void) dealloc { + [self.game removeEventListener:@selector(onTouch:) atObject:self forType:SP_EVENT_TYPE_TOUCH]; + [super dealloc]; +} + +- (void) tick:(float)elapsed { + [self.coolAtk tick:elapsed]; + [super tick:elapsed]; +} + - (void) onTouch:(SPTouchEvent*)event { SPTouch* touch = [[event touchesWithTarget:self.shape.parent] anyObject]; - if (touch) { - SPPoint* touchPosition = [touch locationInSpace:self.shape.parent]; + if (touch && [self.coolAtk activate]) { + // Touch's normal vector in local coords (rel unit origin) + SPPoint* normVec = [[[touch locationInSpace:self.shape.parent] subtractPoint:self.shape.position] normalize]; + + // Bullet starting position + float offset = 7.5f + fmaxf(self.shape.width, self.shape.height) * 1.41421356237f; // bullet_radius + tank_diagonal_length + SPPoint* start = [[self.shape.position addPoint:[normVec scaleBy:offset]] scaleBy:1.0f/self.world.scale]; + QQBullet* bullet = [[[QQBullet alloc] init:self x:start.x y:start.y] autorelease]; + // Bullet impulse vector + SPPoint* imp = [normVec scaleBy:50]; + [bullet applyLinearImpulseX:imp.x y:imp.y]; + NSLog(@"[%@ pos:(%f,%f) impulse:(%f,%f)]", bullet, bullet.x,bullet.y, imp.x,imp.y); } } @@ -34,7 +59,8 @@ float y = self.shape.y = touchPosition.y - self.shape.height / 2.0f; float px = self.world.scale; - self.body->SetTransform(b2Vec2(x/px, y/px), self.body->GetAngle()); + [self setPositionX:x/px y:y/px]; + // self.body->SetTransform(b2Vec2(x/px, y/px), self.body->GetAngle()); } } diff --git a/src/main.mm b/src/main.mm index af502d5..9e6716c 100644 --- a/src/main.mm +++ b/src/main.mm @@ -1,4 +1,5 @@ #import +#import "Tanks.h" int main(int argc, char *argv[]) diff --git a/src/physics/QQPhysics.h b/src/physics/QQPhysics.h new file mode 100644 index 0000000..459f73a --- /dev/null +++ b/src/physics/QQPhysics.h @@ -0,0 +1,4 @@ +#include +#import "Sparrow.h" + +(CGPoint) CGPointFromB2Vec2(const b2Vec2 vec){ return CGPointMake(vec.x, vec.y); } diff --git a/src/physics/QQPoint.h b/src/physics/QQPoint.h new file mode 100644 index 0000000..78102cd --- /dev/null +++ b/src/physics/QQPoint.h @@ -0,0 +1,6 @@ +#import "QQProtocol.h" + +@interface QQPoint + + +@end diff --git a/src/physics/QQPoint.mm b/src/physics/QQPoint.mm new file mode 100644 index 0000000..8898774 --- /dev/null +++ b/src/physics/QQPoint.mm @@ -0,0 +1,12 @@ +#import "QQPoint.h" + + +@implementation QQPoint + +- (id) init { + if ((self = [super init])){ + + } + return self; +} +@end diff --git a/src/physics/QQWorld.mm b/src/physics/QQWorld.mm index ed3abd2..ed986f9 100644 --- a/src/physics/QQWorld.mm +++ b/src/physics/QQWorld.mm @@ -29,11 +29,12 @@ _walls = [[NSMutableArray alloc] initWithCapacity:4]; CGSize screen = [UIScreen mainScreen].bounds.size; - float w = screen.width; - float h = screen.height; - b2Vec2 origin = b2Vec2(0.0f, 0.0f); - b2Vec2 horz = b2Vec2(w, 0.0f); - b2Vec2 vert = b2Vec2(0.0f, h); + float pad = 5; + float w = screen.width / _scale; + float h = screen.height / _scale; + b2Vec2 origin = b2Vec2(pad, pad); + b2Vec2 horz = b2Vec2(w-2*pad, pad); + b2Vec2 vert = b2Vec2(pad, h-2*pad); b2Vec2 positions[] = { b2Vec2(w*0.5f, h*0.0f), diff --git a/src/qq/QQNotifier.h b/src/qq/QQNotifier.h new file mode 100644 index 0000000..2986b99 --- /dev/null +++ b/src/qq/QQNotifier.h @@ -0,0 +1,15 @@ +#import "qq/QQObservable.h" + +@protocol QQNotifier + +- (void) addObserver:(id)observer selector:(SEL)selector name:(NSString*)event object:(id)sender; + +//- (void) removeObserver:(id)observer; // XXX: supposed to remove all from all objects +- (void) removeObserver:(id)observer name:(NSString*)event object:(id)sender; + +- (void) postNotification:(NSNotification*)msg; +- (void) postNotificationName:(NSString*)name object:(id)sender; +- (void) postNotificationName:(NSString*)name object:(id)sender userInfo:(NSDictionary*)info; + + +@end diff --git a/src/qq/QQObject.h b/src/qq/QQObject.h new file mode 100644 index 0000000..e1a151f --- /dev/null +++ b/src/qq/QQObject.h @@ -0,0 +1,10 @@ + + +@interface QQObject : NSObject { +@private + +} + + + +@end diff --git a/src/qq/QQObject.mm b/src/qq/QQObject.mm new file mode 100644 index 0000000..9bd7ea9 --- /dev/null +++ b/src/qq/QQObject.mm @@ -0,0 +1,12 @@ +#import "QQObject.h" + + +@implementation QQObject + +- (id) init { + if ((self = [super init])){ + + } + return self; +} +@end diff --git a/src/qq/QQObservable.h b/src/qq/QQObservable.h new file mode 100644 index 0000000..103ec6f --- /dev/null +++ b/src/qq/QQObservable.h @@ -0,0 +1,16 @@ + + +@protocol QQObservable + +//- (void) observe:(NSString*)event notify:(id)observer selector:(SEL)selector; +- (void) addObserver:(id)observer selector:(SEL)selector name:(NSString*)event; + +- (void) removeObserver:(id)observer; +- (void) removeObserver:(id)observer name:(NSString*)event; + +- (void) postNotification:(NSNotification*)msg; +- (void) postNotificationName:(NSString*)name object:(id)sender; +- (void) postNotificationName:(NSString*)name object:(id)sender userInfo:(NSDictionary*)info; + + +@end diff --git a/src/render/QQSparrowExtensions.h b/src/render/QQSparrowExtensions.h index 076ee38..d38f677 100644 --- a/src/render/QQSparrowExtensions.h +++ b/src/render/QQSparrowExtensions.h @@ -1,9 +1,23 @@ #import "SPDisplayObject.h" +#import "SPPoint.h" +struct b2Vec2; @interface SPDisplayObject (QQSparrowExtensions) +/** Coordinates of the object relative to the local coordinates of the parent. */ +@property (nonatomic, readwrite, assign) SPPoint* position; + +/** Sets coordinates of the object relative to the local coordinates of the parent. */ - (id) setPositionX:(float)x y:(float)y; @end + + +@interface SPPoint (QQSparrowExtensions) +- (CGPoint) toCGPoint; ++ (SPPoint*) pointFromCGPoint:(CGPoint)pt; ++ (SPPoint*) pointFromB2Vec2:(b2Vec2)vec; +@end + diff --git a/src/render/QQSparrowExtensions.mm b/src/render/QQSparrowExtensions.mm index 8226e98..74ec9b1 100644 --- a/src/render/QQSparrowExtensions.mm +++ b/src/render/QQSparrowExtensions.mm @@ -1,12 +1,37 @@ #import "QQSparrowExtensions.h" +#import @implementation SPDisplayObject (QQSparrowExtensions) +- (SPPoint*) position { + return [SPPoint pointWithX:mX y:mY]; +} +- (void) setPosition:(SPPoint*)pt { + [self setPositionX:pt.x y:pt.y]; +} + - (id) setPositionX:(float)x y:(float)y { self.x = x; self.y = y; return self; } -@end \ No newline at end of file +@end + + + +@implementation SPPoint (QQSparrowExtensions) +- (CGPoint) toCGPoint { + return CGPointMake(mX, mY); +} + ++ (SPPoint*) pointFromCGPoint:(CGPoint)pt { + return [SPPoint pointWithX:pt.x y:pt.y]; +} + ++ (SPPoint*) pointFromB2Vec2:(b2Vec2)vec { + return [SPPoint pointWithX:vec.x y:vec.y]; +} + +@end diff --git a/tanks.xcodeproj/project.pbxproj b/tanks.xcodeproj/project.pbxproj index bd5f63c..531b7af 100644 --- a/tanks.xcodeproj/project.pbxproj +++ b/tanks.xcodeproj/project.pbxproj @@ -8,9 +8,6 @@ /* Begin PBXBuildFile section */ 492D80CC138B231B0042D918 /* QQPhysical.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80CB138B231B0042D918 /* QQPhysical.h */; }; - 492D80D5138B233E0042D918 /* QQUnitBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80CF138B233E0042D918 /* QQUnitBase.h */; }; - 492D80D6138B233E0042D918 /* QQUnitBase.mm in Sources */ = {isa = PBXBuildFile; fileRef = 492D80D0138B233E0042D918 /* QQUnitBase.mm */; }; - 492D80DA138B4B110042D918 /* QQUnitDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80D9138B4B110042D918 /* QQUnitDelegate.h */; }; 492D80E4138BA4910042D918 /* QQCooldown.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80DE138BA4910042D918 /* QQCooldown.h */; }; 492D80E5138BA4910042D918 /* QQCooldown.mm in Sources */ = {isa = PBXBuildFile; fileRef = 492D80DF138BA4910042D918 /* QQCooldown.mm */; }; 492D80EB138BA4B40042D918 /* QQTank.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80E9138BA4B40042D918 /* QQTank.h */; }; @@ -18,6 +15,19 @@ 492D80F0138BA4BC0042D918 /* QQBullet.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80EE138BA4BC0042D918 /* QQBullet.h */; }; 492D80F1138BA4BC0042D918 /* QQBullet.mm in Sources */ = {isa = PBXBuildFile; fileRef = 492D80EF138BA4BC0042D918 /* QQBullet.mm */; }; 492D80F3138BA4CE0042D918 /* QQThing.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80F2138BA4CE0042D918 /* QQThing.h */; }; + 492D80FD138BCA840042D918 /* QQUnit.mm in Sources */ = {isa = PBXBuildFile; fileRef = 492D80FC138BCA840042D918 /* QQUnit.mm */; }; + 492D80FF138BCC9F0042D918 /* QQActorDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D80FE138BCC9F0042D918 /* QQActorDelegate.h */; }; + 492D810C138C07540042D918 /* BEParallaxSprite.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D8101138C07540042D918 /* BEParallaxSprite.h */; }; + 492D810D138C07540042D918 /* BEParallaxSprite.m in Sources */ = {isa = PBXBuildFile; fileRef = 492D8102138C07540042D918 /* BEParallaxSprite.m */; }; + 492D810E138C07540042D918 /* SHCircle.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D8103138C07540042D918 /* SHCircle.h */; }; + 492D810F138C07540042D918 /* SHCircle.m in Sources */ = {isa = PBXBuildFile; fileRef = 492D8104138C07540042D918 /* SHCircle.m */; }; + 492D8110138C07540042D918 /* SHLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D8105138C07540042D918 /* SHLine.h */; }; + 492D8111138C07540042D918 /* SHLine.m in Sources */ = {isa = PBXBuildFile; fileRef = 492D8106138C07540042D918 /* SHLine.m */; }; + 492D8112138C07540042D918 /* SHPolygon.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D8107138C07540042D918 /* SHPolygon.h */; }; + 492D8113138C07540042D918 /* SHPolygon.m in Sources */ = {isa = PBXBuildFile; fileRef = 492D8108138C07540042D918 /* SHPolygon.m */; }; + 492D8114138C07540042D918 /* SparrowExtras.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D8109138C07540042D918 /* SparrowExtras.h */; }; + 492D8115138C07540042D918 /* SXFPSMeter.h in Headers */ = {isa = PBXBuildFile; fileRef = 492D810A138C07540042D918 /* SXFPSMeter.h */; }; + 492D8116138C07540042D918 /* SXFPSMeter.m in Sources */ = {isa = PBXBuildFile; fileRef = 492D810B138C07540042D918 /* SXFPSMeter.m */; }; 494DE9971376927C00FDB3D7 /* libBox2D.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 494DE9961376927C00FDB3D7 /* libBox2D.a */; }; 4995ABB213816CCE00334646 /* QQGame.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834A513812427007A6598 /* QQGame.h */; }; 4995ABB313816CD400334646 /* QQUnit.h in Headers */ = {isa = PBXBuildFile; fileRef = 49E834A213812427007A6598 /* QQUnit.h */; }; @@ -172,9 +182,6 @@ /* Begin PBXFileReference section */ 492D80CB138B231B0042D918 /* QQPhysical.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = QQPhysical.h; path = src/game/QQPhysical.h; sourceTree = SOURCE_ROOT; }; - 492D80CF138B233E0042D918 /* QQUnitBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQUnitBase.h; sourceTree = ""; }; - 492D80D0138B233E0042D918 /* QQUnitBase.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QQUnitBase.mm; sourceTree = ""; }; - 492D80D9138B4B110042D918 /* QQUnitDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQUnitDelegate.h; sourceTree = ""; }; 492D80DE138BA4910042D918 /* QQCooldown.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQCooldown.h; sourceTree = ""; }; 492D80DF138BA4910042D918 /* QQCooldown.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QQCooldown.mm; sourceTree = ""; }; 492D80E9138BA4B40042D918 /* QQTank.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQTank.h; sourceTree = ""; }; @@ -182,6 +189,19 @@ 492D80EE138BA4BC0042D918 /* QQBullet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQBullet.h; sourceTree = ""; }; 492D80EF138BA4BC0042D918 /* QQBullet.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QQBullet.mm; sourceTree = ""; }; 492D80F2138BA4CE0042D918 /* QQThing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQThing.h; sourceTree = ""; }; + 492D80FC138BCA840042D918 /* QQUnit.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = QQUnit.mm; sourceTree = ""; }; + 492D80FE138BCC9F0042D918 /* QQActorDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QQActorDelegate.h; sourceTree = ""; }; + 492D8101138C07540042D918 /* BEParallaxSprite.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BEParallaxSprite.h; sourceTree = ""; }; + 492D8102138C07540042D918 /* BEParallaxSprite.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BEParallaxSprite.m; sourceTree = ""; }; + 492D8103138C07540042D918 /* SHCircle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHCircle.h; sourceTree = ""; }; + 492D8104138C07540042D918 /* SHCircle.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHCircle.m; sourceTree = ""; }; + 492D8105138C07540042D918 /* SHLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHLine.h; sourceTree = ""; }; + 492D8106138C07540042D918 /* SHLine.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHLine.m; sourceTree = ""; }; + 492D8107138C07540042D918 /* SHPolygon.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SHPolygon.h; sourceTree = ""; }; + 492D8108138C07540042D918 /* SHPolygon.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SHPolygon.m; sourceTree = ""; }; + 492D8109138C07540042D918 /* SparrowExtras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SparrowExtras.h; path = ../Extras/SparrowExtras.h; sourceTree = ""; }; + 492D810A138C07540042D918 /* SXFPSMeter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SXFPSMeter.h; sourceTree = ""; }; + 492D810B138C07540042D918 /* SXFPSMeter.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SXFPSMeter.m; sourceTree = ""; }; 494DE9961376927C00FDB3D7 /* libBox2D.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libBox2D.a; sourceTree = SOURCE_ROOT; }; 4995ABCA1381C46B00334646 /* Icon-iPad.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-iPad.png"; sourceTree = ""; }; 4995ABCB1381C46B00334646 /* Icon-iPhone.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-iPhone.png"; sourceTree = ""; }; @@ -395,6 +415,24 @@ path = actor/bullet; sourceTree = ""; }; + 492D8100138C07540042D918 /* Extras */ = { + isa = PBXGroup; + children = ( + 492D8101138C07540042D918 /* BEParallaxSprite.h */, + 492D8102138C07540042D918 /* BEParallaxSprite.m */, + 492D8103138C07540042D918 /* SHCircle.h */, + 492D8104138C07540042D918 /* SHCircle.m */, + 492D8105138C07540042D918 /* SHLine.h */, + 492D8106138C07540042D918 /* SHLine.m */, + 492D8107138C07540042D918 /* SHPolygon.h */, + 492D8108138C07540042D918 /* SHPolygon.m */, + 492D810A138C07540042D918 /* SXFPSMeter.h */, + 492D810B138C07540042D918 /* SXFPSMeter.m */, + ); + name = Extras; + path = ../Extras; + sourceTree = ""; + }; 4995ABC61381C46B00334646 /* assets */ = { isa = PBXGroup; children = ( @@ -525,12 +563,11 @@ 49E8349F13812427007A6598 /* actor */ = { isa = PBXGroup; children = ( - 492D80D9138B4B110042D918 /* QQUnitDelegate.h */, - 492D80CF138B233E0042D918 /* QQUnitBase.h */, - 492D80D0138B233E0042D918 /* QQUnitBase.mm */, + 492D80FE138BCC9F0042D918 /* QQActorDelegate.h */, 49E834A013812427007A6598 /* QQActor.h */, 49E834A113812427007A6598 /* QQActor.mm */, 49E834A213812427007A6598 /* QQUnit.h */, + 492D80FC138BCA840042D918 /* QQUnit.mm */, ); path = actor; sourceTree = ""; @@ -639,7 +676,9 @@ 49F2DA1A13764ED5000B6B8C /* Textures */, 49F2DA1B13764ED5000B6B8C /* Animation */, 49F2DA1C13764ED5000B6B8C /* Utils */, + 492D8100138C07540042D918 /* Extras */, 49F2DA1D13764ED5000B6B8C /* Sparrow.h */, + 492D8109138C07540042D918 /* SparrowExtras.h */, ); name = Sparrow; path = libs/sparrow/src/Classes; @@ -931,12 +970,17 @@ 49E834CD13814F7D007A6598 /* QQGLESDebugDraw.h in Headers */, 49E834D3138166A6007A6598 /* QQSparrowExtensions.h in Headers */, 492D80CC138B231B0042D918 /* QQPhysical.h in Headers */, - 492D80D5138B233E0042D918 /* QQUnitBase.h in Headers */, - 492D80DA138B4B110042D918 /* QQUnitDelegate.h in Headers */, 492D80E4138BA4910042D918 /* QQCooldown.h in Headers */, 492D80EB138BA4B40042D918 /* QQTank.h in Headers */, 492D80F0138BA4BC0042D918 /* QQBullet.h in Headers */, 492D80F3138BA4CE0042D918 /* QQThing.h in Headers */, + 492D80FF138BCC9F0042D918 /* QQActorDelegate.h in Headers */, + 492D810C138C07540042D918 /* BEParallaxSprite.h in Headers */, + 492D810E138C07540042D918 /* SHCircle.h in Headers */, + 492D8110138C07540042D918 /* SHLine.h in Headers */, + 492D8112138C07540042D918 /* SHPolygon.h in Headers */, + 492D8114138C07540042D918 /* SparrowExtras.h in Headers */, + 492D8115138C07540042D918 /* SXFPSMeter.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -1079,10 +1123,15 @@ 49E834C713812555007A6598 /* QQViewport.mm in Sources */, 49E834CE13814F7D007A6598 /* QQGLESDebugDraw.mm in Sources */, 49E834D4138166A6007A6598 /* QQSparrowExtensions.mm in Sources */, - 492D80D6138B233E0042D918 /* QQUnitBase.mm in Sources */, 492D80E5138BA4910042D918 /* QQCooldown.mm in Sources */, 492D80EC138BA4B40042D918 /* QQTank.mm in Sources */, 492D80F1138BA4BC0042D918 /* QQBullet.mm in Sources */, + 492D80FD138BCA840042D918 /* QQUnit.mm in Sources */, + 492D810D138C07540042D918 /* BEParallaxSprite.m in Sources */, + 492D810F138C07540042D918 /* SHCircle.m in Sources */, + 492D8111138C07540042D918 /* SHLine.m in Sources */, + 492D8113138C07540042D918 /* SHPolygon.m in Sources */, + 492D8116138C07540042D918 /* SXFPSMeter.m in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; -- 1.7.0.4