         ball.position = location
         ball.physicsBody = SKPhysicsBody(circleOfRadius: width)
         ball.physicsBody?.dynamic = true
+        ball.physicsBody?.categoryBitMask = CATEGORY_BALL
+        ball.physicsBody?.contactTestBitMask = CATEGORY_RACKET
         self.addChild(ball)
     }
     

            var isRacket = false
            for r in self.children {
                if r.name == "racket" {
                    if r.containsPoint(location) {
                        print(location)
                        r.physicsBody?.applyImpulse(CGVectorMake(0, 1000))
                        isRacket = true
                    }
                }


import SpriteKit

class GameScene: SKScene, SKPhysicsContactDelegate {
    
    var initPostision: CGPoint?
    let CATEGORY_RACKET: UInt32 = 0x00000001
    let CATEGORY_BALL: UInt32 = 0x00000010
    
    // not supported construct.
    required init(coder aDecoder: NSCoder) {
