softbody

Is there a way to make a soft body with Spritekit using SKSpriteNode and PhysicsBody parameters?

做~自己de王妃 提交于 2019-12-21 20:06:07
问题 I have the following sprite that falls to the bottom of the screen: // 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

Is there a way to make a soft body with Spritekit using SKSpriteNode and PhysicsBody parameters?

这一生的挚爱 提交于 2019-12-04 14:46:15
I have the following sprite that falls to the bottom of the screen: // 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; Is there a way to make it so its sides are bulging when it hits