added pausing the camera.
This commit is contained in:
@@ -541,6 +541,7 @@
|
||||
entities {:rooms rooms
|
||||
:step-particles (assoc (particle-effect "ego/step") :x 100 :y 100 :baseline 241)
|
||||
:cam {:zoom 0.95
|
||||
:paused? false
|
||||
:object nil}
|
||||
:musics {:object nil
|
||||
:inside-antique (utils/make-music "inside-antique.ogg")
|
||||
@@ -619,8 +620,9 @@
|
||||
[id ((:update-fn entity) screen entities entity)]
|
||||
[id entity])))))
|
||||
|
||||
entities (if (and (nil? (get-in entities [:tweens :cam-x]))
|
||||
(= 1 (rand-int 20)))
|
||||
entities (if (and (not (get-in entities [:cam :paused?]))
|
||||
(nil? (get-in entities [:tweens :cam-x]))
|
||||
(= 1 (rand-int 20)))
|
||||
(if (= (rand-int 2) 1)
|
||||
(actions/pan-to screen entities
|
||||
(get-in entities [:room :entities :ego :x])
|
||||
@@ -642,12 +644,11 @@
|
||||
layers (get-layers entities)
|
||||
|
||||
all-entities (concat (vals entities) layers (vals (get-in entities [:room :entities])))]
|
||||
(when (nil? (:zoom (:cam entities)))
|
||||
(println entities))
|
||||
(screen! talking-screen :on-update-camera :scene-viewport (:viewport screen) :scene-camera (:camera screen))
|
||||
(set! (. camera zoom) (:zoom (:cam entities)))
|
||||
(set! (.. camera position x) (:x (:cam entities) 160.0))
|
||||
(set! (.. camera position y) (:y (:cam entities) 120.0))
|
||||
(when (not (get-in entities [:cam :paused?]))
|
||||
(set! (. camera zoom) (:zoom (:cam entities)))
|
||||
(set! (.. camera position x) (:x (:cam entities) 160.0))
|
||||
(set! (.. camera position y) (:y (:cam entities) 120.0)))
|
||||
(let [entities (utils/update-override screen entities)]
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user