-3

I am trying to make an infinite bouncing game like doodle jump. I am trying to allow the ball to pass through the block when it is heading in the upwards Y direction but when the ball is falling allow it to make contact with the block.

Web_Designer
  • 72,308
  • 93
  • 206
  • 262
heyguyss
  • 1
  • 1
  • What have you tried so far? You might want to check out the documentation for how to make a [Minimal, Complete, and Verifiable example](https://stackoverflow.com/help/mcve) of whatever problem you're facing. – Michael Fourre Mar 15 '17 at 19:38

1 Answers1

0

In the update function of your scene, you could check the velocity of the ball and modify either its collisionBitMask or categoryBitMask to avoid collision with the block when the velocity vector is going up and allow it when its going down. (those are attributes of the SKPhysicsBody of your ball.)

Alain T.
  • 40,517
  • 4
  • 31
  • 51