Flatten the entities vector and improve the animation function
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
:delta-time 0)
|
||||
on-show
|
||||
vec
|
||||
flatten
|
||||
(reset! entities)))
|
||||
(render [delta-time]
|
||||
(let [total-time (+ (:total-time @screen) delta-time)
|
||||
@@ -46,6 +47,7 @@
|
||||
(->> (on-render screen-map @entities)
|
||||
(remove nil?)
|
||||
vec
|
||||
flatten
|
||||
(reset! entities)
|
||||
(draw! screen-map))))
|
||||
(hide [] (on-hide @screen))
|
||||
|
||||
@@ -47,6 +47,6 @@
|
||||
|
||||
(defn get-key-frame
|
||||
([screen ^Animation animation]
|
||||
(get-key-frame screen animation true))
|
||||
(.getKeyFrame animation (:total-time screen) true))
|
||||
([screen ^Animation animation is-looping?]
|
||||
(.getKeyFrame animation (:total-time screen) is-looping?)))
|
||||
|
||||
Reference in New Issue
Block a user