diff --git a/common/src/play_clj/core.clj b/common/src/play_clj/core.clj index 23ce394..5afee5f 100644 --- a/common/src/play_clj/core.clj +++ b/common/src/play_clj/core.clj @@ -36,6 +36,7 @@ :total-time 0 :delta-time 0) on-show + vec (reset! entities))) (render [delta-time] (let [total-time (+ (:total-time @screen) delta-time) @@ -43,6 +44,8 @@ :total-time total-time :delta-time delta-time)] (->> (on-render screen-map @entities) + (remove nil?) + vec (reset! entities) (draw! screen-map)))) (hide [] (on-hide @screen)) diff --git a/common/src/play_clj/core_2d.clj b/common/src/play_clj/core_2d.clj index 848885f..ce9ec7c 100644 --- a/common/src/play_clj/core_2d.clj +++ b/common/src/play_clj/core_2d.clj @@ -45,8 +45,8 @@ (utils/static-field :graphics :g2d :Animation ~(or (first args) :normal)))) -(defn get-animation-frame +(defn get-key-frame ([screen ^Animation animation] - (get-animation-frame screen animation true)) + (get-key-frame screen animation true)) ([screen ^Animation animation is-looping?] (.getKeyFrame animation (:total-time screen) is-looping?)))