lullaby. better safe experience.

This commit is contained in:
Bryce Covert
2016-06-15 17:50:40 -07:00
parent 3d203a6d3a
commit 0962cd6478
8 changed files with 113 additions and 59 deletions

View File

@@ -998,16 +998,19 @@
(map (partial + 16) [5 6 7 8 8 7 6 6 6 6 6])
(repeat 45 22)])
[22 22 22 22 22 22 22 22 26 27 28]
[22 22 22 22 22 22 22 22 26 27 28 28 28 28 28 28 28 28 28 28 28 28 28 28]
]))]
(Thread/sleep 200)
(wait entities 200)
(begin-animation entities :ego :whistle)
(wait entities 400)
(add-entity entities :safe-song
(rooms/make-entity :safe-song
(assoc (utils/get-texture "safe-song/safe-song-1")
:x 130
:y 120
:baseline 241
:night-profile :none
:anim nil
:anim-start 0
:play safe-song-anim)))
@@ -1015,5 +1018,6 @@
(begin-animation entities :safe-song :play)
(wait entities 100)
(play-sound entities "safe-sound.ogg" 0.1 false)
(wait entities 10000)
(remove-entity entities :safe-song)))
(wait entities 10800)
(remove-entity entities :safe-song)
(do-stop entities :ego)))

View File

@@ -193,6 +193,8 @@
:flask-1 (actions/get-script entities
(actions/do-dialogue entities
:wizard "You can keep the flask."))
:tune (actions/get-script entities
(actions/talk entities :ego "I think he already has it memorized."))
(actions/get-script entities
(actions/do-dialogue entities
:wizard "No thank you.")))})

View File

@@ -27,17 +27,17 @@
(assoc :start-showing? false)))
(defn button-box [x y]
(zone/box (+ start-x x) (+ start-y y) (+ start-x x 16) (+ start-y y 16)))
(zone/box (+ start-x x) (+ start-y y) (+ start-x x 16) (+ start-y y 20)))
(defn get-button [[x y]]
(first (filter (fn [{:keys [in?] :as button}]
(when (in? x y)
button))
[{:in? (button-box 9 17) :sound (utils/load-sound "inside-house/safe-1.ogg") :id 1 }
{:in? (button-box 29 17) :sound (utils/load-sound "inside-house/safe-2.ogg") :id 2}
{:in? (button-box 49 17) :sound (utils/load-sound "inside-house/safe-3.ogg") :id 3}
{:in? (button-box 70 17) :sound (utils/load-sound "inside-house/safe-4.ogg") :id 4}
{:in? (button-box 91 17) :sound (utils/load-sound "inside-house/safe-5.ogg") :id 5}])))
[{:in? (button-box 9 13) :sound (utils/load-sound "inside-house/safe-1.ogg") :id 1 }
{:in? (button-box 29 13) :sound (utils/load-sound "inside-house/safe-2.ogg") :id 2}
{:in? (button-box 49 13) :sound (utils/load-sound "inside-house/safe-3.ogg") :id 3}
{:in? (button-box 70 13) :sound (utils/load-sound "inside-house/safe-4.ogg") :id 4}
{:in? (button-box 91 13) :sound (utils/load-sound "inside-house/safe-5.ogg") :id 5}])))
(defscreen safe-screen
:on-show

View File

@@ -317,11 +317,24 @@ void main ()
:tune
(actions/get-script entities
(if (get-in @entities [:room :entities :wizard])
(cond
(get-in @entities [:room :entities :wizard])
(do
(actions/talk entities :ego "Better not hum it with Gandarf around!")
(actions/talk entities :wizard "What's that, boy?")
(actions/talk entities :ego "Oh... Erm... Nothing."))
(get-in @entities [:room :entities :warden])
(do
(actions/talk entities :ego "I'll whistle it really quietly.")
(actions/play-safe entities)
(actions/do-dialogue entities :warden "Huh? What was that?"
:warden "Get back in yer cell!")
(common/go-to-jail entities)
(Thread/sleep 500)
(actions/play-animation entities :ego :sigh)
(actions/talk entities :ego "You really are a sucker for punishment, aren't you?")
(steam/set-achievement "FOOLISH_LULLABY"))
:else
(do
(actions/talk entities :ego "Ugh! I have Gandarf's MagicSafe 2000 tune stuck in my head.")
(actions/play-safe entities))))
@@ -498,13 +511,15 @@ void main ()
(texture (aget squat-sheet 0 i))))
start-squat-2 (animation 0.05 (for [i [0 1 2 3]]
(texture (aget squat-sheet 0 i))))
end-squat (animation 0.05 (for [i [3 2 1 0]]
(texture (aget squat-sheet 0 i))))
squat-anim (animation 0.05 (for [i [0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 2 1] ]
squat-anim (animation 0.05 (for [i [0 1 2 3 3 3 3 3 3 3 3 3 3 3 3 2 1]]
(texture (aget squat-sheet 0 i))))
reach-anim (animation 0.1 (for [i [0 1 2 3 3 3 3 3 3 2 1 0]]
(texture (aget reach-sheet 0 i))))
reach-start (animation 0.1 (for [i [0 1 2 3 ]]
reach-start (animation 0.1 (for [i [0 1 2 3]]
(texture (aget reach-sheet 0 i))))
reach-stop (animation 0.1 (for [i [3 2 1 0]]
(texture (aget reach-sheet 0 i))))
@@ -514,10 +529,11 @@ void main ()
(texture (aget cat-toy-sheet 0 i))))
cat-toy-last-half (animation 0.1 (for [i [3 3 3 2 1 1 0 0]]
(texture (aget cat-toy-sheet 0 i))))
shy (animation 0.2 (for [i [0 1 2 2 2 2 2 2 2 2 1 0 0 0 0 0 0 0 ]]
(texture (aget fire-sheet 0 i))))
shy (animation 0.2 (for [i [0 1 2 2 2 2 2 2 2 2 1 0 0 0 0 0 0 0]]
(texture (aget fire-sheet 0 i))))
fire-1-anim (animation 0.1 (for [i [0 1 2 2 2 3 2 3 2 2 2 2 2 2 2 2 2 2 1 0]]
(texture (aget fire-sheet 0 i))))
fire-2-anim (animation 0.1 (for [i [0 1 2 2 2 3 2 3 2 2 2 2 2 2 2 4 4 4 5 6 7 4 4 4 2 2 2 2 2 2 2 2 1 0]]
(texture (aget fire-sheet 0 i))))
fire-3-anim (animation 0.1 (for [i [0 1 2 2 2 3 2 3 2 2 2 2 2 2 4 4 4 4 4 4 5 6 7 4 4 4 4 4 8 9 10 11 4 4 4 2 2 2 2 2 2 2 2 0]]
@@ -554,6 +570,7 @@ void main ()
frustrated-talk (utils/make-anim "ego/frustrated-talk.png" [16 36] 0.2 (flatten (range 6)))
swing-shovel (utils/make-anim "ego/swing-shovel.png" [70 70] 0.1 (range 9))
love (utils/make-anim-seq "ego/love" [50 70] 0.1 (flatten [0 0 1 1 2 2 3 3 4 4 5 5 6 6 (repeat 10 7) (repeat 5 8) (repeat 5 7) (repeat 5 8) (repeat 5 7) (repeat 10 [23 24 25 24]) (repeat 30 9) 10 11 12 13 14 15 16 17 18 19 20 21 21 21 22 22 22 21 21 21 21 21 21 21 21 22 22 22 22 22 21 21 21 21 22 22 22 22 22 22 21 21 21 21 21 6 6 5 5 4 4 3 3 2 2 1 1 0]))
whistle (utils/make-anim-seq "ego/whistle" [18 36] 0.2 (flatten [0 1 1 (repeat 200 [2 3])]))
axe (utils/make-anim "ego/axe.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 7)]))
axe-wood (utils/make-anim "ego/axe-wood.png" [60 70] 0.10 (flatten [1 1 1 1 1 0 0 0 1 1 1 1 1 0 0 0 0 (range 11)]))
suspended (utils/make-anim "ego/suspended.png" [20 36] 0.10 [0])
@@ -630,6 +647,7 @@ void main ()
:shy shy
:climb climb
:poke poke
:whistle whistle
}
:left {:walk (utils/flip walk-right)
:stand (utils/flip stand-anim)
@@ -681,6 +699,7 @@ void main ()
:shy (utils/flip shy)
:climb (utils/flip climb)
:poke (utils/flip poke)
:whistle (utils/flip whistle)
}
:baseline (- 240 (last start-pos))
:facing :right
@@ -786,6 +805,7 @@ void main ()
(get-in ego [:right :glad]) {:origin-x 11}
(get-in ego [:left :climb]) {:origin-x 11}
(get-in ego [:right :climb]) {:origin-x 11}
(get-in ego [:left :whistle]) {:origin-x 7}
(get-in ego [:right :standup]) {:origin-x 32}
(get-in ego [:right :crawl]) {:origin-x 32}
(get-in ego [:right :crawl-hide]) {:origin-x 32}