fixed fade jump, and fixed match in subtract
This commit is contained in:
@@ -5,7 +5,6 @@ sound duration on android
|
|||||||
choosing interaction feels wrong - flies hard to touch
|
choosing interaction feels wrong - flies hard to touch
|
||||||
change hotspots as necessary
|
change hotspots as necessary
|
||||||
turn off desk hotspots if you don't have inventory
|
turn off desk hotspots if you don't have inventory
|
||||||
Fade out needs to start at 100 opacity
|
|
||||||
less common for gandarfs experiment
|
less common for gandarfs experiment
|
||||||
delay in update with label causes jumpiness
|
delay in update with label causes jumpiness
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
:scale-y 100
|
:scale-y 100
|
||||||
:x -1
|
:x -1
|
||||||
:y -1
|
:y -1
|
||||||
:opacity 0.0
|
:opacity 1.0
|
||||||
:origin-x 0
|
:origin-x 0
|
||||||
:origin-y 0)})
|
:origin-y 0)})
|
||||||
|
|
||||||
|
|||||||
@@ -646,7 +646,7 @@
|
|||||||
:else
|
:else
|
||||||
(do (actions/play-animation entities :door :open)
|
(do (actions/play-animation entities :door :open)
|
||||||
(actions/transition-background entities :inside-house [237 0] :between (fn [s e]
|
(actions/transition-background entities :inside-house [237 0] :between (fn [s e]
|
||||||
(if (= 1 (rand-int 2))
|
(if (= 1 (rand-int 5))
|
||||||
(assoc-in e [:room :entities :experiment] (get-in e [:room :experiment]))
|
(assoc-in e [:room :entities :experiment] (get-in e [:room :experiment]))
|
||||||
e)))
|
e)))
|
||||||
(when (get-in @entities [:room :entities :experiment])
|
(when (get-in @entities [:room :entities :experiment])
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ void main ()
|
|||||||
maximum-x (- 320 margin-width)
|
maximum-x (- 320 margin-width)
|
||||||
label-width (label! l :get-width)
|
label-width (label! l :get-width)
|
||||||
label-right (+ (:x l) (/ label-width 2))
|
label-right (+ (:x l) (/ label-width 2))
|
||||||
_ (println label-right)
|
|
||||||
l (cond (> label-right maximum-x) (assoc l :x (- maximum-x label-width))
|
l (cond (> label-right maximum-x) (assoc l :x (- maximum-x label-width))
|
||||||
(< (:x l) minimum-x) (assoc l :x minimum-x)
|
(< (:x l) minimum-x) (assoc l :x minimum-x)
|
||||||
:else l)]
|
:else l)]
|
||||||
@@ -984,15 +983,17 @@ void main ()
|
|||||||
(if (not (get-in entities [:started? :value]))
|
(if (not (get-in entities [:started? :value]))
|
||||||
(do (music! (utils/get-current-music entities) :set-volume (utils/current-music-volume (get-in entities [:volume :value])))
|
(do (music! (utils/get-current-music entities) :set-volume (utils/current-music-volume (get-in entities [:volume :value])))
|
||||||
(utils/play-music (get-in entities [:musics (actions/get-music (get-in entities [:room :music]) (get-in entities [:state :time]))]))
|
(utils/play-music (get-in entities [:musics (actions/get-music (get-in entities [:room :music]) (get-in entities [:state :time]))]))
|
||||||
(assoc entities
|
(-> entities
|
||||||
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic
|
(assoc
|
||||||
:finish #(if (not (get-in % [:state :seen-intro?]))
|
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic
|
||||||
(do ((actions/get-script % (rooms.dream/do-intro %)) entities)
|
:finish #(if (not (get-in % [:state :seen-intro?]))
|
||||||
%)
|
(do ((actions/get-script % (rooms.dream/do-intro %)) entities)
|
||||||
%))
|
%)
|
||||||
:fade-in-music (tween/tween :fade-in-music screen [:volume :value] 0.0 1.0 1.0 :ease tween/ease-in-cubic)}
|
%))
|
||||||
:started? {:value true
|
:fade-in-music (tween/tween :fade-in-music screen [:volume :value] 0.0 1.0 1.0 :ease tween/ease-in-cubic)}
|
||||||
:object nil}))
|
:started? {:value true
|
||||||
|
:object nil})
|
||||||
|
(assoc-in [:fade :opacity] 1.0)))
|
||||||
entities))
|
entities))
|
||||||
|
|
||||||
(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 {}}}]
|
||||||
@@ -1907,14 +1908,12 @@ void main ()
|
|||||||
|
|
||||||
:on-give-item
|
:on-give-item
|
||||||
(fn [screen entities {:keys [item]}]
|
(fn [screen entities {:keys [item]}]
|
||||||
(doto
|
(-> entities
|
||||||
(-> entities
|
(update-in [:inv-fsm :pending-states] conj [:acquire item])
|
||||||
(update-in [:inv-fsm :pending-states] conj [:acquire item])
|
(update-in [:inv-fsm] (fn [{:keys [state state-data] :as fsm}]
|
||||||
(update-in [:inv-fsm] (fn [{:keys [state state-data] :as fsm}]
|
(if (and (= state :selected) (= item state-data))
|
||||||
(if (and (= state :selected) (= item state-data))
|
(update-in fsm [:pending-states] conj [:none state-data])
|
||||||
(update-in fsm [:pending-states] conj [:none state-data])
|
(update-in fsm [:pending-states] conj [:none state-data]))))))
|
||||||
(update-in fsm [:pending-states] conj [:none state-data])))))
|
|
||||||
(#(println (get-in % [:inv-fsm :pending-states])))))
|
|
||||||
|
|
||||||
:on-remove-item
|
:on-remove-item
|
||||||
(fn [screen entities {:keys [item]}]
|
(fn [screen entities {:keys [item]}]
|
||||||
|
|||||||
@@ -6,8 +6,8 @@
|
|||||||
(fn ^double [^double t ^double start ^double delta ^double duration]
|
(fn ^double [^double t ^double start ^double delta ^double duration]
|
||||||
(let [pct-done (/ t duration)
|
(let [pct-done (/ t duration)
|
||||||
pct-done (Math/pow pct-done power)]
|
pct-done (Math/pow pct-done power)]
|
||||||
(+ start
|
(+ start
|
||||||
(* delta pct-done)))))
|
(* delta pct-done)))))
|
||||||
|
|
||||||
(def ease-linear (ease-in-expo-maker 1.0))
|
(def ease-linear (ease-in-expo-maker 1.0))
|
||||||
(def ease-in-quadratic (ease-in-expo-maker 2.0))
|
(def ease-in-quadratic (ease-in-expo-maker 2.0))
|
||||||
@@ -42,9 +42,9 @@
|
|||||||
|
|
||||||
(defn ease-out-quadratic ^double [^double t ^double start ^double delta ^double duration]
|
(defn ease-out-quadratic ^double [^double t ^double start ^double delta ^double duration]
|
||||||
(let [t (/ t duration)]
|
(let [t (/ t duration)]
|
||||||
(unchecked-add (-> (unchecked-subtract 1 delta)
|
(unchecked-add (-> (unchecked-subtract 0.0 delta)
|
||||||
(unchecked-multiply t)
|
(unchecked-multiply t)
|
||||||
(unchecked-multiply (unchecked-subtract t 2)))
|
(unchecked-multiply (unchecked-subtract t 2.0)))
|
||||||
start)))
|
start)))
|
||||||
|
|
||||||
(defn ease-out-cubic ^double [^double t ^double start ^double delta ^double duration]
|
(defn ease-out-cubic ^double [^double t ^double start ^double delta ^double duration]
|
||||||
|
|||||||
Reference in New Issue
Block a user