making the coin-getting puzzle.

This commit is contained in:
Bryce Covert
2015-07-29 22:35:47 -07:00
parent d3e75d4835
commit 3f354a6515
20 changed files with 368 additions and 2 deletions

View File

@@ -144,8 +144,12 @@
a (catmull-rom-spline! (:path entity) :value-at v pos-f)]
(assoc entity :x (vector-2! v :x) :y (vector-2! v :y)))))))
(defn path-point [speed screen entities entity]
(* (- (:total-time screen) (:path-start-time entity 0.0)) speed)
)
(defn update-path-location [speed screen entities entity]
(let [pos-f (- (* (- (:total-time screen) (:path-start-time entity 0.0)) speed) (int (* (- (:total-time screen) (:path-start-time entity 0.0)) speed)))
(let [pos-f (- (path-point speed screen entities entity) (int (* (- (:total-time screen) (:path-start-time entity 0.0)) speed)))
v (vector-2 0 0)
a (catmull-rom-spline! (:path entity) :value-at v pos-f)]
(assoc entity :x (vector-2! v :x) :y (vector-2! v :y))))