嗨,我要拍下面的代碼Box2D的:使用Box2D的
-(void)shooter
{
LHSprite* laserSprite = [lh newPhysicalSpriteWithUniqueName:@"ball_1" ];
b2Body* laserBody = [laserSprite body];
[self addChild:laserSprite z:10];
NSAssert(laserSprite!=nil, @"Couldn't find devil1");
[laserSprite transformPosition:_hero.position];
b2Vec2 ballvel = laserBody->GetLinearVelocity();
ballvel.x = 16;
laserBody->SetLinearVelocity(ballvel);
}
上面的代碼射精靈右側我sprite..i使用,
拍攝左側,但我要拍左側。即使我改變了ballvel.x = 16; to ballvel.x = -16;它還是向右side..please幫助拍攝
我是新來的Box2D所以請溫柔:)
這是否說明爲什麼沒有按-16」工作? – 2012-07-12 14:44:59
權力的價值應該是什麼?有些近似? – vishnu 2012-07-12 14:53:47