camera shake.
This commit is contained in:
@@ -880,3 +880,35 @@
|
||||
(fade-out-georgia entities)
|
||||
(do-stop entities :georgia-face)
|
||||
(transition-music entities nil :duration 1.0))))
|
||||
|
||||
|
||||
(defn do-pan [entities x y scale-fn & [ease duration]]
|
||||
(actions/run-action entities
|
||||
(begin [this screen entities]
|
||||
(pan-to screen entities x y scale-fn ease duration))
|
||||
|
||||
(continue [this screen entities]
|
||||
entities)
|
||||
|
||||
(done? [this screen entities]
|
||||
(nil? (get-in entities [:tweens :cam-y])))
|
||||
|
||||
(terminate [this screen entities]
|
||||
entities)
|
||||
(skip-type [this screen entities]
|
||||
:none)))
|
||||
|
||||
(defn camera-shake [entities length]
|
||||
(dotimes [n length]
|
||||
(actions/do-pan entities (get-in @entities [:cam :x])
|
||||
(+ (get-in @entities [:cam :y])
|
||||
5)
|
||||
(constantly (get-in @entities [:cam :zoom]))
|
||||
nil
|
||||
(* 0.01 (inc n)))
|
||||
(actions/do-pan entities (get-in @entities [:cam :x])
|
||||
(- (get-in @entities [:cam :y])
|
||||
5)
|
||||
(constantly (get-in @entities [:cam :zoom]))
|
||||
nil
|
||||
(* 0.01 (inc n)))))
|
||||
|
||||
@@ -263,6 +263,8 @@
|
||||
(particle-effect! (get-in @entities [:room :entities :magic]) :allow-completion)
|
||||
(actions/resume-camera entities)
|
||||
(actions/transition-music entities nil)
|
||||
(actions/camera-shake entities 12)
|
||||
(Thread/sleep 500)
|
||||
(actions/do-dialogue entities :ego "That was weird."
|
||||
:ego "I have to go show my friends!")
|
||||
|
||||
|
||||
@@ -258,7 +258,10 @@
|
||||
(actions/do-dialogue entities :ego "Geronimo!!")
|
||||
(actions/play-sound entities
|
||||
"inside-jail/guard-crash.ogg"
|
||||
0.5)
|
||||
0.6 false)
|
||||
|
||||
(actions/camera-shake entities 6)
|
||||
|
||||
(actions/begin-animation entities :warden :stand)
|
||||
(Thread/sleep 300)
|
||||
(actions/do-dialogue entities
|
||||
|
||||
Reference in New Issue
Block a user