kind of nice sequence.
This commit is contained in:
@@ -1 +1 @@
|
|||||||
{:active? true, :convinced-wizard? true, :time :day, :inventory [:ladder :glass-eye :recipe :grass :medal :kiss :trophy :flask-1-strength :sword], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :space, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :sword :flask-1 :grass :ladder :trophy}}
|
{:active? true, :seen-bloodclot? true :convinced-wizard? true, :time :day, :inventory [:ladder :glass-eye :recipe :grass :medal :kiss :trophy :flask-1-strength :sword], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :space, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :sword :flask-1 :grass :ladder :trophy}}
|
||||||
|
|||||||
@@ -469,11 +469,12 @@
|
|||||||
music
|
music
|
||||||
(time music)))
|
(time music)))
|
||||||
|
|
||||||
(defn transition-music [entities new-music]
|
(defn transition-music [entities new-music & {:keys [duration]}]
|
||||||
(let [current-volume (atom 1.0)]
|
(let [current-volume (atom 1.0)
|
||||||
|
duration (or duration 2.0)]
|
||||||
(run-action entities
|
(run-action entities
|
||||||
(begin [this screen entities]
|
(begin [this screen entities]
|
||||||
(assoc-in entities [:tweens :fade-out-music] (utils/tween :fade-out-music screen [:volume :value] 1.0 0.0 2.0)))
|
(assoc-in entities [:tweens :fade-out-music] (utils/tween :fade-out-music screen [:volume :value] 1.0 0.0 duration)))
|
||||||
|
|
||||||
(continue [this screen entities]
|
(continue [this screen entities]
|
||||||
entities)
|
entities)
|
||||||
|
|||||||
@@ -14,11 +14,14 @@
|
|||||||
(defn bloodclot-appear [entities]
|
(defn bloodclot-appear [entities]
|
||||||
(actions/run-action entities
|
(actions/run-action entities
|
||||||
(begin [this screen entities]
|
(begin [this screen entities]
|
||||||
|
(particle-effect! (get-in entities [:room :entities :appear]) :reset)
|
||||||
|
(particle-effect! (get-in entities [:room :entities :appear]) :start)
|
||||||
|
(sound! (sound "inside-house/disappear.ogg") :play)
|
||||||
(-> entities
|
(-> entities
|
||||||
(assoc-in [:tweens :bloodclot-head-appear]
|
(assoc-in [:tweens :bloodclot-head-appear]
|
||||||
(utils/tween :bloodclot-head-appear screen [:room :entities :bloodclot-head :opacity] 0.0 1.0 0.2 :power 4.0))
|
(utils/tween :bloodclot-head-appear screen [:room :entities :bloodclot-head :opacity] 0.0 1.0 1.0 :power 4.0))
|
||||||
(assoc-in [:tweens :bloodclot-appear]
|
(assoc-in [:tweens :bloodclot-appear]
|
||||||
(utils/tween :bloodclot-appear screen [:room :entities :bloodclot :opacity] 0.0 1.0 0.2 :power 4.0))))
|
(utils/tween :bloodclot-appear screen [:room :entities :bloodclot :opacity] 0.0 1.0 1.0 :power 4.0))))
|
||||||
|
|
||||||
(continue [this screen entities]
|
(continue [this screen entities]
|
||||||
entities)
|
entities)
|
||||||
@@ -119,8 +122,9 @@
|
|||||||
(actions/walk-to entities :ego [85 145] :face :right)
|
(actions/walk-to entities :ego [85 145] :face :right)
|
||||||
(actions/transition-background entities :space [0 65] :transition-music? false)
|
(actions/transition-background entities :space [0 65] :transition-music? false)
|
||||||
(actions/walk-straight-to entities :ego [160 45] :face :right)
|
(actions/walk-straight-to entities :ego [160 45] :face :right)
|
||||||
(actions/transition-music entities nil)
|
|
||||||
(bloodclot-appear entities))
|
(bloodclot-appear entities)
|
||||||
|
(actions/transition-music entities nil :duration 0.15))
|
||||||
|
|
||||||
(defn pull-sword [entities]
|
(defn pull-sword [entities]
|
||||||
(actions/play-animation entities :ego :reach)
|
(actions/play-animation entities :ego :reach)
|
||||||
|
|||||||
@@ -37,6 +37,29 @@
|
|||||||
(assoc-in e [:tweens :flash] (utils/tween :flash screen [:white-fade :opacity] 0.0 1.0 0.5 :power 3.0))
|
(assoc-in e [:tweens :flash] (utils/tween :flash screen [:white-fade :opacity] 0.0 1.0 0.5 :power 3.0))
|
||||||
e))
|
e))
|
||||||
|
|
||||||
|
(defn bloodclot-disappear [entities]
|
||||||
|
(actions/run-action entities
|
||||||
|
(begin [this screen entities]
|
||||||
|
(particle-effect! (get-in entities [:room :entities :appear]) :reset)
|
||||||
|
(particle-effect! (get-in entities [:room :entities :appear]) :start)
|
||||||
|
(sound! (sound "inside-house/disappear.ogg") :play)
|
||||||
|
(-> entities
|
||||||
|
(assoc-in [:tweens :bloodclot-head-appear]
|
||||||
|
(utils/tween :bloodclot-head-appear screen [:room :entities :bloodclot-head :opacity] 1.0 0.0 1.0 :power 4.0))
|
||||||
|
(assoc-in [:tweens :bloodclot-appear]
|
||||||
|
(utils/tween :bloodclot-appear screen [:room :entities :bloodclot :opacity] 1.0 0.0 1.0 :power 4.0))))
|
||||||
|
|
||||||
|
(continue [this screen entities]
|
||||||
|
entities)
|
||||||
|
|
||||||
|
(done? [this screen entities]
|
||||||
|
(= 0.0 (get-in entities [:room :entities :bloodclot :opacity])))
|
||||||
|
|
||||||
|
(terminate [this screen entities]
|
||||||
|
entities)
|
||||||
|
(can-skip? [this screen entities]
|
||||||
|
false)))
|
||||||
|
|
||||||
(defn swing-at-blergh [entities]
|
(defn swing-at-blergh [entities]
|
||||||
(let [jump-path (bezier (map #(apply vector-2* %) [[35 45] [110 145] [195 180]]))
|
(let [jump-path (bezier (map #(apply vector-2* %) [[35 45] [110 145] [195 180]]))
|
||||||
swing-path (bezier (map #(apply vector-2* %) [[195 180] [205 45]]))
|
swing-path (bezier (map #(apply vector-2* %) [[195 180] [205 45]]))
|
||||||
@@ -146,13 +169,17 @@
|
|||||||
blergh-swing (utils/make-anim "space/blergh-swing.png" [106 165] 0.1 [0 0 1 2 3 4 ])
|
blergh-swing (utils/make-anim "space/blergh-swing.png" [106 165] 0.1 [0 0 1 2 3 4 ])
|
||||||
blergh-appear (utils/make-anim "space/blergh-appear.png" [106 165] 0.05 (flatten [(range 13) 12 12 12 12 12 12 12 12 12 12 12 12 12 ]))
|
blergh-appear (utils/make-anim "space/blergh-appear.png" [106 165] 0.05 (flatten [(range 13) 12 12 12 12 12 12 12 12 12 12 12 12 12 ]))
|
||||||
blergh-grow (utils/make-anim "space/blergh-grow.png" [106 165] 0.10 [0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11])
|
blergh-grow (utils/make-anim "space/blergh-grow.png" [106 165] 0.10 [0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11])
|
||||||
bullet (utils/make-anim "space/bullet.png" [24 24] 0.0075 [0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 3 3 3 4 4 5 5 6 5 4 7])]
|
bullet (utils/make-anim "space/bullet.png" [24 24] 0.0075 [0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 3 3 3 4 4 5 5 6 5 4 7])
|
||||||
|
effect (particle-effect "space/appear")]
|
||||||
(rooms/make :music :fight
|
(rooms/make :music :fight
|
||||||
:interactions
|
:interactions
|
||||||
{}
|
{}
|
||||||
:layers [(assoc (texture "space/background.png") :x 0 :y 0 :baseline 0)]
|
:layers [(assoc (texture "space/background.png") :x 0 :y 0 :baseline 0)]
|
||||||
:timers {:taunt [10.0 8.0 taunt]}
|
:timers {:taunt [10.0 8.0 taunt]}
|
||||||
:entities {:bloodclot-head (assoc (animation->texture screen bloodclot-head-stand-anim)
|
:entities {:appear (assoc effect
|
||||||
|
:x 240 :y 50
|
||||||
|
:baseline 200)
|
||||||
|
:bloodclot-head (assoc (animation->texture screen bloodclot-head-stand-anim)
|
||||||
:x 195 :y 138 :baseline 195
|
:x 195 :y 138 :baseline 195
|
||||||
:opacity 0.0
|
:opacity 0.0
|
||||||
:anim bloodclot-head-stand-anim
|
:anim bloodclot-head-stand-anim
|
||||||
@@ -170,7 +197,8 @@
|
|||||||
:appear blergh-appear
|
:appear blergh-appear
|
||||||
:grow blergh-grow
|
:grow blergh-grow
|
||||||
|
|
||||||
:script (actions/get-script entities (actions/do-dialogue entities :bloodclot-head "Come on! Try and hit me!"))
|
:script (actions/get-script entities
|
||||||
|
(actions/do-dialogue entities :bloodclot-head "Come on! Try and hit me!"))
|
||||||
:scripts {:sword (actions/get-script entities
|
:scripts {:sword (actions/get-script entities
|
||||||
(swing-at-blergh entities)
|
(swing-at-blergh entities)
|
||||||
|
|
||||||
@@ -189,9 +217,9 @@
|
|||||||
:bloodclot-head "Tomorrow, I will return with my legion of goblins."
|
:bloodclot-head "Tomorrow, I will return with my legion of goblins."
|
||||||
:bloodclot-head "And THEN the feast will begin."
|
:bloodclot-head "And THEN the feast will begin."
|
||||||
:bloodclot-head "Starting with his precious Georgia McGorgeous.")
|
:bloodclot-head "Starting with his precious Georgia McGorgeous.")
|
||||||
|
(bloodclot-disappear entities)
|
||||||
(common/go-to-jail entities)
|
(common/go-to-jail entities)
|
||||||
#_(actions/do-dialogue entities :ego "Hey!"
|
(actions/do-dialogue entities :ego "Hey!" :ego "What's going on? I was just about to teach Bloodclot a lesson!"))
|
||||||
:ego "What's going on? I was just about to teach Blergh a lesson!"))
|
|
||||||
:magic-slingshot (actions/get-script entities
|
:magic-slingshot (actions/get-script entities
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
:ego "Hey Blergh!"
|
:ego "Hey Blergh!"
|
||||||
|
|||||||
@@ -37,6 +37,7 @@
|
|||||||
[java.lang Object]
|
[java.lang Object]
|
||||||
[com.badlogic.gdx Gdx]))
|
[com.badlogic.gdx Gdx]))
|
||||||
|
|
||||||
|
|
||||||
(def default-interaction
|
(def default-interaction
|
||||||
{:get-script (fn [cursor [x y]] (if (= :main cursor)
|
{:get-script (fn [cursor [x y]] (if (= :main cursor)
|
||||||
(actions/get-script entities
|
(actions/get-script entities
|
||||||
@@ -487,6 +488,7 @@
|
|||||||
(when m
|
(when m
|
||||||
(music! m :set-volume (get-in entities [:volume :value]) )))
|
(music! m :set-volume (get-in entities [:volume :value]) )))
|
||||||
|
|
||||||
|
|
||||||
(label! (:fps entities) :set-text (str (game :fps)))
|
(label! (:fps entities) :set-text (str (game :fps)))
|
||||||
(render! screen (sort-by :baseline all-entities))
|
(render! screen (sort-by :baseline all-entities))
|
||||||
#_(render! screen [(:fps entities)])
|
#_(render! screen [(:fps entities)])
|
||||||
|
|||||||
@@ -60,7 +60,7 @@
|
|||||||
:on-render
|
:on-render
|
||||||
(fn [screen [entities]]
|
(fn [screen [entities]]
|
||||||
(let [entities (utils/apply-tweens screen entities (:tweens entities))]
|
(let [entities (utils/apply-tweens screen entities (:tweens entities))]
|
||||||
(music! (:music entities) :set-volume (:volume entities))
|
(music! (:music entities) :set-volume 0.0 #_(:volume entities))
|
||||||
(render! screen [(:overlay entities) (:start-playing entities) (:quit entities) (:fade entities)])
|
(render! screen [(:overlay entities) (:start-playing entities) (:quit entities) (:fade entities)])
|
||||||
entities))
|
entities))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user