                         (let [moved-entity (-> entity
                                                update-orientation
                                                update-velocity
+                                               apply-friction
                                                update-position)]
 
                           (doseq [axis [:x :y]]

            (update-in [:motion :velocity :y]
                       (partial update-axis-velocity Math/sin))))
      entity)))

(sm/defn update-position :- Entity
  [entity :- Entity]

      (let [orientation (get-in entity [:shape :orientation])
            update-axis-velocity (fn [trig-fn axis-velocity]
                                   (let [new-velocity (min (get-in entity [:motion :max-speed])
                                                           (+ axis-velocity
                                                              (* acceleration
                                                                 (trig-fn orientation))))]
                                     (if (> (Math/abs new-velocity) min-velocity)
                                       new-velocity
                                       0)))]
