我有一个精灵,它会落到屏幕底部:
有没有一种方法可以让它在撞击屏幕底部时两侧凸出?可能是像果冻一样柔软的物体,保留一定的形状但在自身重量下会凸出。希望你能理解...
// The View
self.physicsBody = [SKPhysicsBody bodyWithEdgeLoopFromRect:self.frame];
self.physicsWorld.contactDelegate = self;
// The Sprite
SKSpriteNode *cube = [[SKSpriteNode alloc] initWithImageNamed:@"cube"];
[cube setPosition:CGPointMake(160,250);
[self addChild:cube];
// The Physics
cube.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:cube.frame.size];
cube.physicsBody.dynamic = YES;
cube.physicsBody.affectedByGravity = YES;
cube.physicsBody.mass = 0.02;
有没有一种方法可以让它在撞击屏幕底部时两侧凸出?可能是像果冻一样柔软的物体,保留一定的形状但在自身重量下会凸出。希望你能理解...