jail candle.

This commit is contained in:
2015-07-26 20:57:15 -07:00
parent b09f530c54
commit eb033e01ba
12 changed files with 267 additions and 8 deletions

View File

@@ -204,12 +204,8 @@
:collision "inside-house/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75)
:apply-state (fn [_ entities]
(particle-effect! (get-in entities [:room :entities :candle-smoke] ) :reset)
(particle-effect! (get-in entities [:room :entities :candle-smoke] ) :start)
(particle-effect! (get-in entities [:room :entities :candle-smoke] ) :update 10.0)
(dotimes [_ 160]
(particle-effect! (get-in entities [:room :entities :candle-smoke] ) :update 0.2))
(utils/fast-forward-particle (get-in entities [:room :entities :candle-smoke]))
(as-> entities entities
(if (actions/has-obtained? entities :flask-1)

View File

@@ -190,7 +190,10 @@
warden-fall-asleep (animation 0.1 (for [i (flatten [(repeat 5 0) 2 2 (repeat 10 0) 2 2 2 2 2 2 2 (repeat 10 0) 2 2 2])]
(aget warden-sheet 0 i)))
warden-sleep (animation 0.5 (for [i (flatten [ 3 3 2 2 2])]
(aget warden-sheet 0 i)))]
(aget warden-sheet 0 i)))
candle (utils/make-anim "inside-jail/candle.png" [20 25] 0.1 (range 4))
candle-aura (utils/make-anim (texture "inside-house/candle-aura.png") [27 27] 0.2 [0 1 2 3 2 1] )
]
(rooms/make :music :inside-antique
:interactions {
:lock {:box [178 102 184 124]
@@ -313,6 +316,18 @@
:moveable-bars (assoc (texture "inside-jail/moveable-bars.png")
:night-profile :none
:x 132 :y 77 :baseline 163)
:candle (assoc (animation->texture screen candle)
:x 207 :y 118 :baseline 2
:anim candle
:anim-start 0
:night-profile :none)
:candle-aura (assoc (animation->texture screen candle-aura) :x 215 :y 130 :baseline 2
:additive? true :origin-x 13 :origin-y 13 :opacity 0.5 :anim candle-aura :anim-start 0 :night-profile :none
:script (actions/get-script entities (actions/talk entities :ego "Just a candle."))
:scripts {:default (actions/get-script entities (actions/talk entities :ego "I might catch the place on fire."))})
:candle-smoke (doto (assoc (particle-effect "inside-jail/candle") :x 215 :y 130
:baseline 200)
(particle-effect! :set-position 215 130))
:crowbar (assoc (texture "inside-jail/crowbar.png")
:x 304 :y 65 :baseline 175
:night-profile :none
@@ -332,6 +347,7 @@
:scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5)
:start-pos [130 85]
:apply-state (fn [_ entities]
(utils/fast-forward-particle (get-in entities [:room :entities :candle-smoke]))
(as-> entities entities
(if (actions/has-obtained? entities :ball-n-chain)
(update-in entities [:room :entities] #(dissoc % :ball-n-chain))

View File

@@ -253,3 +253,11 @@
175.0)))
(* (or scale 1.0))
(clamp-volume)))
(defn fast-forward-particle [p]
(particle-effect! p :reset)
(particle-effect! p :start)
(particle-effect! p :update 10.0)
(dotimes [_ 160]
(particle-effect! p :update 0.2)))