fixing skipped frame issue
This commit is contained in:
@@ -911,12 +911,22 @@
|
|||||||
(assoc-in [:fade :opacity] 1.0)))
|
(assoc-in [:fade :opacity] 1.0)))
|
||||||
entities))
|
entities))
|
||||||
|
|
||||||
|
(defn get-necessary-sound [anim-sound-frames previous-frame-index current-frame-index]
|
||||||
|
(loop [x (inc previous-frame-index)]
|
||||||
|
(cond
|
||||||
|
(anim-sound-frames x)
|
||||||
|
(anim-sound-frames x)
|
||||||
|
|
||||||
|
(< x current-frame-index )
|
||||||
|
(recur (inc x))
|
||||||
|
|
||||||
|
:else
|
||||||
|
nil)))
|
||||||
|
|
||||||
(defn play-sound-if-necessary [screen entities target {:keys [previous-frame-index current-frame-index anim-sound-frames anim x y] :as e :or {anim-sound-frames {}}}]
|
(defn play-sound-if-necessary [screen entities target {:keys [previous-frame-index current-frame-index anim-sound-frames anim x y] :as e :or {anim-sound-frames {}}}]
|
||||||
|
|
||||||
|
|
||||||
(if (and (not= previous-frame-index current-frame-index)
|
(if (and (not= previous-frame-index current-frame-index)
|
||||||
(anim-sound-frames anim))
|
(anim-sound-frames anim))
|
||||||
(if-let [[snd vol-scale pitch] (get-in anim-sound-frames [anim current-frame-index])]
|
(if-let [[snd vol-scale pitch] (get-necessary-sound (anim-sound-frames anim) previous-frame-index current-frame-index)]
|
||||||
(let [snd (if (fn? snd)
|
(let [snd (if (fn? snd)
|
||||||
(snd entities)
|
(snd entities)
|
||||||
snd)
|
snd)
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
<key>CFBundleSignature</key>
|
<key>CFBundleSignature</key>
|
||||||
<string>????</string>
|
<string>????</string>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>124</string>
|
<string>126</string>
|
||||||
<key>MinimumOSVersion</key>
|
<key>MinimumOSVersion</key>
|
||||||
<string>8.0</string>
|
<string>8.0</string>
|
||||||
<key>LSRequiresIPhoneOS</key>
|
<key>LSRequiresIPhoneOS</key>
|
||||||
|
|||||||
Reference in New Issue
Block a user