I got 2 objects, a Human and a Block. If the Human is on the Block, he is able to jump, if he is in the air, he isn't. How can I code that, cause the CGRectIntersectsRect doesn't work in SpriteKit for me.
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent )event { / Called when a touch begins */
Human.physicsBody.velocity = CGVectorMake(0, 0);
[Human.physicsBody applyImpulse:CGVectorMake(0, 40)];
}
I got the Block and the Human already in Categorys, for Collision detection :
else if ((firstBody.categoryBitMask & HumanCategory) != 0 &&
(secondBody.categoryBitMask & BlockCategory) != 0)
{
}
Should I use that somehow for the code? Thanks for helping.