 import SpriteKit
 
 struct PhysicsCatagory {
-    static let Ghost : UInt32 = 0x1 << 1
-    static let Ground : UInt32 = 0x1 << 2
-    static let Wall : UInt32 = 0x1 << 3
-    static let Line : UInt32 = 0x1 << 4
+    static let Ghost    : UInt32 = 0x1 << 1
+    static let Ground   : UInt32 = 0x1 << 2
+    static let Wall     : UInt32 = 0x1 << 3
+    static let Score    : UInt32 = 0x1 << 4
 }
 
 
-class GameScene: SKScene {
+class GameScene: SKScene, SKPhysicsContactDelegate{
     
     var ground = SKSpriteNode()
     var ghost = SKSpriteNode()

        ghost.physicsBody = SKPhysicsBody(circleOfRadius: ghost.frame.height/2)
        ghost.physicsBody?.categoryBitMask = PhysicsCatagory.Ghost
        ghost.physicsBody?.collisionBitMask = PhysicsCatagory.Ground | PhysicsCatagory.Wall
        ghost.physicsBody?.contactTestBitMask = PhysicsCatagory.Ground | PhysicsCatagory.Wall
        ghost.physicsBody?.dynamic = true
        ghost.physicsBody?.affectedByGravity = false
        

    var gameStarted = Bool()
    
    override func didMoveToView(view: SKView) {
        
        
        self.physicsWorld.contactDelegate = self
        
        ground = SKSpriteNode(imageNamed: "ground")
        ground.setScale(0.5)
