如何創建SKPhysicsBody bodyWithBodies?
我是新的,我嘗試過,但它只是不會出現在模擬器上。有人可以舉一個例子嗎? 這裏是我的代碼部分:Xcode上的BodyWithBodies
Bike = [SKSpriteNode node];
Bike.physicsBody = [SKPhysicsBody bodyWithBodies:bikeArray];
Bike.position = CGPointMake(100, 100);
//Bike.size = CGSizeMake(40, 50);
Bike.physicsBody.mass = 0.1;
//Bike.physicsBody.dynamic = YES;
Bike.physicsBody.affectedByGravity = YES;
Bike.physicsBody.restitution = 0;
Bike.physicsBody.friction = 0;
Bike.physicsBody.allowsRotation = YES;
Bike.name = @"Bike";
[self addChild:Bike];
坦克,
你是什麼意思「不會出現」?一個物理體本身看起來不像任何東西。 –