intro sequence shaping up.

This commit is contained in:
2015-03-11 21:34:50 -07:00
parent 6eae1dddc3
commit 2f11012831
4 changed files with 151 additions and 21 deletions

View File

@@ -398,7 +398,7 @@
(utils/load)
{:object nil
:active? true
:last-room :outside-house
:last-room :dream
:time :day
:obtained-items #{}
:inventory []
@@ -411,7 +411,11 @@
(do (music! (utils/get-current-music entities) :set-volume (utils/current-music-volume (get-in entities [:volume :value])))
(utils/play-sound (get-in entities [:musics (actions/get-music (get-in entities [:room :music]) (get-in entities [:state :time]))]))
(assoc entities
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic)
:tweens {:fade-in (tween/tween :fade-in screen [:fade :opacity] 1.0 0.0 1.0 :ease tween/ease-in-cubic
:finish #(if (not (get-in % [:state :seen-intro?]))
(do ((actions/get-script % (rooms.dream/do-intro %)) entities)
(assoc-in % [:actions :script-running?] true))
%))
: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
:object nil}))
@@ -466,12 +470,16 @@
(.begin batch)
(.setProjectionMatrix batch parallax-combined)
(.setColor batch (color 1 1 1 (or (:opacity e) 1.0)))
(entities/draw! (assoc e :x (+ (/ (:x e) (.zoom camera))
(- (* 320 parallax 0.5)
(/ 160 (.zoom camera)) ))
:y (+ (/ (:y e) (.zoom camera))
(- (* 240 parallax 0.5)
(/ 120 (.zoom camera))))) screen batch)
(.setColor batch (color 1 1 1 1))
(.end batch))))
@@ -570,8 +578,7 @@
(doseq [[k [start time fn]] (get-in entities [:room :timers])]
(add-timer! screen k start time))
#_(when (not (get-in entities [:state :seen-intro?]))
((actions/get-script entities (rooms.dream/do-intro entities)) entities))
(if-let [apply-state (get-in entities [:room :apply-state])]