talking animation.
This commit is contained in:
@@ -56,10 +56,13 @@
|
||||
|
||||
(defn get-ego [screen]
|
||||
(let [player-sheet (texture! (texture "player.png") :split 18 36)
|
||||
talk-sheet (texture! (texture "ego/talk.png") :split 16 36)
|
||||
ego {:right (animation 0.075 (for [i (range 8)]
|
||||
(texture (aget player-sheet 0 i))))
|
||||
:left (animation 0.075 (for [i (range 8)]
|
||||
(texture (aget player-sheet 1 i))))
|
||||
:talk (animation 0.2 (for [i (range 8)]
|
||||
(texture (aget talk-sheet 0 i))))
|
||||
|
||||
:baseline 95
|
||||
:origin-x 9
|
||||
@@ -94,8 +97,8 @@
|
||||
background-trees (texture "background-trees.png")
|
||||
house (texture "house.png")
|
||||
overdirt (texture "overdirt.png")
|
||||
music (sound "outside-house.mp3")
|
||||
;; _ (sound! music :loop)
|
||||
music (sound "town-music.mp3")
|
||||
_ (sound! music :loop)
|
||||
]
|
||||
{
|
||||
:cursor {:id "cursor" :cursor-index 0 }
|
||||
@@ -114,7 +117,8 @@
|
||||
:interactions [{:mouse-in? (zone/box 258 100 281 160)
|
||||
:click-fn (fn [screen entities [x y]]
|
||||
(assoc-in entities [:ego :actions] [(actions/stop :ego)
|
||||
(actions/talk :ego "Looking at the house.")]))}]
|
||||
(actions/talk :ego (str "The last time I went through that door, \n"
|
||||
"Fangald turned me into a frog."))]))}]
|
||||
:scale-fn (scaler-fn-with-baseline 110 0.10 1.00)
|
||||
:layers [(assoc background :x 0 :y 0 :baseline 0)
|
||||
(assoc house :x 0 :y 0 :baseline 122)
|
||||
|
||||
Reference in New Issue
Block a user