     (and (not (= @last-boost-value "SHIELD")) (not (= @last-boost-value "BOOST")) (= @last-shield-usage 0))))
 
 (defn use-shield? [x y opponent-x opponent-y boost-used? game-loop-counter max-shield-usage last-shield-usage last-boost-value]
-  (and (= @last-shield-usage 0) (> @game-loop-counter 10) (> @max-shield-usage 0) (< (distance opponent-x opponent-y x y) 1000)))
+  (and (= @last-shield-usage 0) (> @game-loop-counter 10) (> @max-shield-usage 0) (< (distance opponent-x opponent-y x y) min-distance-to-activate-shield)))
 
 ;;Compute BOOST, SHIELD or boost value between 0 and 100
 (defn compute-action [next-checkpoint-x next-checkpoint-y next-checkpoint-distance next-checkpoint-angle x y opponent-x opponent-y boost-used? game-loop-counter max-shield-usage last-shield-usage last-boost-value]

  (if (> next-checkpoint-distance 1000)
    (cond
      (and (>= next-checkpoint-angle -90) (<= next-checkpoint-angle 90) (before next-checkpoint-x x))
      (convert-to-int (+ next-checkpoint-x (* checkpoint-core-size (Math/cos next-checkpoint-angle))))
      (and (>= next-checkpoint-angle -90) (<= next-checkpoint-angle 90) (after next-checkpoint-x x))
      (convert-to-int (- next-checkpoint-x (* checkpoint-core-size (Math/cos next-checkpoint-angle))))
      (or (<= -180 next-checkpoint-angle -90 ) (>= 180 next-checkpoint-angle 90))
      (convert-to-int (- next-checkpoint-x (* checkpoint-core-size (Math/cos next-checkpoint-angle)))))
    next-checkpoint-x))

(defn compute-y [y next-checkpoint-y next-checkpoint-angle next-checkpoint-distance]
  (if (cond
        (and (>= next-checkpoint-angle 0)  (<= next-checkpoint-angle 180)) (convert-to-int (- next-checkpoint-y (* checkpoint-core-size (Math/sin next-checkpoint-angle))))
        (and (< next-checkpoint-angle 0) (>= next-checkpoint-angle -180)) (convert-to-int (+ next-checkpoint-y (* checkpoint-core-size (Math/sin next-checkpoint-angle)))))
    next-checkpoint-y))

;;Angle entre 2 points (x1,y1) et (x2,y2)


        ; (binding [*out* *err*]
        ;   (println "Debug messages..."))
        (binding [*out* *err*]
          (println (str "Has the boost been used ? : " @boost-used?))
          (println (str "Next check point distance coordinates : (" nextCheckpointX "," nextCheckpointY ")"))
          (println (str "Given next check point distance : " nextCheckpointDist))
          (println (str "Calculated next check point distance : " (distance x y nextCheckpointX nextCheckpointY)))
          (println (str "Pod angle with checkpoint : " nextCheckpointAngle))
          (println (str "Calculated Pod angle with checkpoint : " (angle-between-2-points x y nextCheckpointX nextCheckpointY)))
          (println (str "Pod Position : (" x "," y ")"))
          (println (str "Opponent pod Position : (" opponentX "," opponentY ")"))
          (println (str "Opponent distance : " opponent-distance))
          (println (str "Calculated Pod angle with opponent : " (angle-between-2-points x y opponentX opponentY)))
          (println (str "Max Shield Usage : " @max-shield-usage))
          (println (str "Last Shield Usage : " @last-shield-usage))
          (println (str "Game loop counter : " @game-loop-counter))
          (println (str "Last boost value : " @last-boost-value)))



