talking animation.
This commit is contained in:
BIN
desktop/resources/ego/talk.png
Normal file
BIN
desktop/resources/ego/talk.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
desktop/resources/ego/talk.pxa/0.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/talk.pxa/1.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/talk.pxa/2.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/talk.pxa/3.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/talk.pxa/4.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/4.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/talk.pxa/5.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/5.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/talk.pxa/6.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/6.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/talk.pxa/7.pxi
Normal file
BIN
desktop/resources/ego/talk.pxa/7.pxi
Normal file
Binary file not shown.
38
desktop/resources/ego/talk.pxa/CelData.plist
Normal file
38
desktop/resources/ego/talk.pxa/CelData.plist
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.20000000298023224</real>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.4 KiB |
BIN
desktop/resources/town-music.mp3
Normal file
BIN
desktop/resources/town-music.mp3
Normal file
Binary file not shown.
@@ -59,7 +59,8 @@
|
||||
(defn talk [target-id text]
|
||||
(fn [screen entities]
|
||||
(run! dialogue/talking-screen :on-talk :text text
|
||||
:x (get-in entities [target-id :x]) :y (+ (get-in entities [target-id :y]) 25)
|
||||
:x (get-in entities [target-id :x]) :y (+ (get-in entities [target-id :y]) 35)
|
||||
:target-id target-id)
|
||||
(-> entities
|
||||
(update-in [target-id :actions] rest))))
|
||||
(update-in [target-id :actions] rest)
|
||||
(assoc-in [target-id :anim] (get-in entities [target-id :talk])))))
|
||||
|
||||
@@ -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