changes
This commit is contained in:
@@ -1 +1 @@
|
|||||||
{:active? true, :seen-frankie? true, :knows-about-stash? true, :convinced-wizard? true, :time :night, :broke-lock? true, :opened-bars? true, :inventory (:slingshot :trophy :medal :flask-1-strength :walkie-talkie :note-2 :spear :camera :note-1 :key :crowbar :ladder :grass :kiss :sword), :wizard-left? false, :dropped-ball? true, :hay-searches 4, :clues #{}, :stop? false, :warden-sleeping? true, :current-riddle :wool, :warden-fast-asleep? true, :last-room :outside-castle, :wants-toy true, :bent-bars? true, :chest-contents [], :mints-eaten 0, :object nil, :talked-to-owl? true, :obtained-items #{:money :flask-2 :key :slingshot :flies :rope :kiss :spear :medal :sword :magic-slingshot :flask-flies-ash :flask-1 :flask-1-strength :flask-water-flies :walkie-talkies :ash :grass :camera :sack-lunch :ladder :walkie-talkie :trophy :broken-clock :monocle :alarm-clock :crowbar :note-1 :flask-water :note-2 :ball-n-chain :feather :spell-component}}
|
{:active? true, :seen-intro? true, :seen-frankie? true, :knows-about-stash? true, :convinced-wizard? true, :time :night, :broke-lock? true, :opened-bars? true, :inventory (:slingshot :trophy :medal :flask-1-strength :walkie-talkie :note-2 :spear :camera :note-1 :key :crowbar :ladder :grass :kiss :sword), :wizard-left? false, :dropped-ball? true, :hay-searches 4, :clues #{}, :stop? false, :warden-sleeping? true, :current-riddle :wool, :warden-fast-asleep? true, :last-room :outside-castle, :wants-toy true, :bent-bars? true, :chest-contents [], :mints-eaten 0, :object nil, :talked-to-owl? true, :obtained-items #{:money :flask-2 :key :slingshot :flies :rope :kiss :spear :medal :sword :magic-slingshot :flask-flies-ash :flask-1 :flask-1-strength :flask-water-flies :walkie-talkies :ash :grass :camera :sack-lunch :ladder :walkie-talkie :trophy :broken-clock :monocle :alarm-clock :crowbar :note-1 :flask-water :note-2 :ball-n-chain :feather :spell-component}}
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{:active? true, :convinced-wizard? true, :inventory [:ladder :glass-eye :recipe :grass :medal :kiss :trophy :flask-1-strength], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :inside-castle, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :flask-1 :grass :ladder :trophy} :time :day}
|
{:active? true, :seen-intro? true :convinced-wizard? true, :inventory [:ladder :glass-eye :recipe :grass :medal :kiss :trophy :flask-1-strength], :wizard-left? false, :clues #{}, :current-riddle :wool, :last-room :inside-castle, :wants-toy true, :mints-eaten 0, :object nil, :obtained-items #{:kiss :medal :flask-1 :grass :ladder :trophy} :time :day}
|
||||||
|
|||||||
@@ -74,16 +74,16 @@ active: true
|
|||||||
lowMin: 0.0
|
lowMin: 0.0
|
||||||
lowMax: 0.0
|
lowMax: 0.0
|
||||||
highMin: 100.0
|
highMin: 100.0
|
||||||
highMax: 200.0
|
highMax: 250.0
|
||||||
relative: false
|
relative: false
|
||||||
scalingCount: 3
|
scalingCount: 3
|
||||||
scaling0: 1.0
|
scaling0: 1.0
|
||||||
scaling1: 0.7755102
|
scaling1: 1.0
|
||||||
scaling2: 0.36734694
|
scaling2: 0.1632653
|
||||||
timelineCount: 3
|
timelineCount: 3
|
||||||
timeline0: 0.0
|
timeline0: 0.0
|
||||||
timeline1: 0.45890412
|
timeline1: 0.46575344
|
||||||
timeline2: 0.7808219
|
timeline2: 0.6917808
|
||||||
- Angle -
|
- Angle -
|
||||||
active: true
|
active: true
|
||||||
lowMin: 270.0
|
lowMin: 270.0
|
||||||
@@ -107,8 +107,8 @@ active: false
|
|||||||
active: true
|
active: true
|
||||||
lowMin: -50.0
|
lowMin: -50.0
|
||||||
lowMax: -50.0
|
lowMax: -50.0
|
||||||
highMin: -120.0
|
highMin: -180.0
|
||||||
highMax: -120.0
|
highMax: -180.0
|
||||||
relative: false
|
relative: false
|
||||||
scalingCount: 2
|
scalingCount: 2
|
||||||
scaling0: 0.0
|
scaling0: 0.0
|
||||||
@@ -160,7 +160,7 @@ scaling2: 0.75
|
|||||||
scaling3: 0.0
|
scaling3: 0.0
|
||||||
timelineCount: 4
|
timelineCount: 4
|
||||||
timeline0: 0.0
|
timeline0: 0.0
|
||||||
timeline1: 0.2
|
timeline1: 0.04109589
|
||||||
timeline2: 0.8
|
timeline2: 0.8
|
||||||
timeline3: 1.0
|
timeline3: 1.0
|
||||||
- Options -
|
- Options -
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
163
desktop/resources/ego/glad-jump
Normal file
163
desktop/resources/ego/glad-jump
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
Untitled
|
||||||
|
- Delay -
|
||||||
|
active: false
|
||||||
|
- Duration -
|
||||||
|
lowMin: 100.0
|
||||||
|
lowMax: 100.0
|
||||||
|
- Count -
|
||||||
|
min: 0
|
||||||
|
max: 100
|
||||||
|
- Emission -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 200.0
|
||||||
|
highMax: 200.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Life -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 800.0
|
||||||
|
highMax: 800.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Life Offset -
|
||||||
|
active: false
|
||||||
|
- X Offset -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Y Offset -
|
||||||
|
active: true
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Spawn Shape -
|
||||||
|
shape: square
|
||||||
|
- Spawn Width -
|
||||||
|
lowMin: 18.0
|
||||||
|
lowMax: 18.0
|
||||||
|
highMin: 10.0
|
||||||
|
highMax: 10.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 2
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 1.0
|
||||||
|
- Spawn Height -
|
||||||
|
lowMin: 5.0
|
||||||
|
lowMax: 5.0
|
||||||
|
highMin: 20.0
|
||||||
|
highMax: 20.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 0.5714286
|
||||||
|
scaling2: 0.6122449
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.5
|
||||||
|
timeline2: 1.0
|
||||||
|
- Scale -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 1
|
||||||
|
scaling0: 1.0
|
||||||
|
timelineCount: 1
|
||||||
|
timeline0: 0.0
|
||||||
|
- Velocity -
|
||||||
|
active: true
|
||||||
|
lowMin: 10.0
|
||||||
|
lowMax: 3.0
|
||||||
|
highMin: 40.0
|
||||||
|
highMax: 30.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 0.0
|
||||||
|
scaling2: 0.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.15068494
|
||||||
|
timeline2: 0.37671232
|
||||||
|
- Angle -
|
||||||
|
active: true
|
||||||
|
lowMin: 220.0
|
||||||
|
lowMax: 320.0
|
||||||
|
highMin: 0.0
|
||||||
|
highMax: 0.0
|
||||||
|
relative: true
|
||||||
|
scalingCount: 3
|
||||||
|
scaling0: 0.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
timelineCount: 3
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.21232876
|
||||||
|
timeline2: 1.0
|
||||||
|
- Rotation -
|
||||||
|
active: false
|
||||||
|
- Wind -
|
||||||
|
active: false
|
||||||
|
- Gravity -
|
||||||
|
active: false
|
||||||
|
- Tint -
|
||||||
|
colorsCount: 6
|
||||||
|
colors0: 0.5647059
|
||||||
|
colors1: 0.7607843
|
||||||
|
colors2: 1.0
|
||||||
|
colors3: 0.34509805
|
||||||
|
colors4: 0.8352941
|
||||||
|
colors5: 1.0
|
||||||
|
timelineCount: 2
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 1.0
|
||||||
|
- Transparency -
|
||||||
|
lowMin: 0.0
|
||||||
|
lowMax: 0.0
|
||||||
|
highMin: 1.0
|
||||||
|
highMax: 1.0
|
||||||
|
relative: false
|
||||||
|
scalingCount: 4
|
||||||
|
scaling0: 1.0
|
||||||
|
scaling1: 1.0
|
||||||
|
scaling2: 1.0
|
||||||
|
scaling3: 0.0
|
||||||
|
timelineCount: 4
|
||||||
|
timeline0: 0.0
|
||||||
|
timeline1: 0.05479452
|
||||||
|
timeline2: 0.34246576
|
||||||
|
timeline3: 1.0
|
||||||
|
- Options -
|
||||||
|
attached: false
|
||||||
|
continuous: false
|
||||||
|
aligned: false
|
||||||
|
additive: true
|
||||||
|
behind: false
|
||||||
|
premultipliedAlpha: false
|
||||||
|
- Image Path -
|
||||||
|
/Users/bryce/dev/playground/advent/desktop/resources/dream/dot.png
|
||||||
BIN
desktop/resources/ego/glad.png
Normal file
BIN
desktop/resources/ego/glad.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.2 KiB |
BIN
desktop/resources/ego/glad.pxa/0.pxi
Normal file
BIN
desktop/resources/ego/glad.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/glad.pxa/1.pxi
Normal file
BIN
desktop/resources/ego/glad.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/glad.pxa/2.pxi
Normal file
BIN
desktop/resources/ego/glad.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/glad.pxa/3.pxi
Normal file
BIN
desktop/resources/ego/glad.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/glad.pxa/4.pxi
Normal file
BIN
desktop/resources/ego/glad.pxa/4.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/glad.pxa/5.pxi
Normal file
BIN
desktop/resources/ego/glad.pxa/5.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/ego/glad.pxa/6.pxi
Normal file
BIN
desktop/resources/ego/glad.pxa/6.pxi
Normal file
Binary file not shown.
34
desktop/resources/ego/glad.pxa/CelData.plist
Normal file
34
desktop/resources/ego/glad.pxa/CelData.plist
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?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>2</real>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>duration</key>
|
||||||
|
<real>0.039999999105930328</real>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>duration</key>
|
||||||
|
<real>0.039999999105930328</real>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>duration</key>
|
||||||
|
<real>0.039999999105930328</real>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>duration</key>
|
||||||
|
<real>0.039999999105930328</real>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>duration</key>
|
||||||
|
<real>1</real>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>duration</key>
|
||||||
|
<real>1</real>
|
||||||
|
</dict>
|
||||||
|
</array>
|
||||||
|
</plist>
|
||||||
@@ -153,14 +153,23 @@
|
|||||||
:x 144 :y 122 :baseline 139
|
:x 144 :y 122 :baseline 139
|
||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(actions/walk-to entities :ego [168 76] :face :left)
|
(actions/walk-to entities :ego [168 76] :face :left)
|
||||||
(actions/do-dialogue entities :ego "Awesome! I'll take this sword and become a knight.")
|
(actions/talk entities :ego "There's a plaque here.")
|
||||||
|
(actions/play-animation entities :ego :squat)
|
||||||
|
(actions/do-dialogue entities
|
||||||
|
:ego "'A noble choice to be a knight,\nBe a hero, do what's right.'"
|
||||||
|
:ego "'There's no need to shove,\nTo find your true love,'"
|
||||||
|
:ego "'Because maidens love guys with might.'"
|
||||||
|
:ego "Awesome!"
|
||||||
|
:ego "If I become a knight, maybe Georgia McGorgeous will love me!")
|
||||||
(actions/stop-walking entities :ego :face :right)
|
(actions/stop-walking entities :ego :face :right)
|
||||||
(actions/do-dialogue entities
|
(actions/do-dialogue entities
|
||||||
:fairy-godfather "Tick, I'm not sure that being a knight is right for you."
|
:fairy-godfather "Tick, I told you that you can't be a knight."
|
||||||
:fairy-godfather "I think you'd be better suited for a more menial job."
|
:fairy-godfather "I think you'd be much better suited for a more menial job."
|
||||||
:ego "Hey! Why can't I be a knight! It's my destiny!"
|
:ego "Hey! Why can't I be a knight? It's my destiny!"
|
||||||
:ego "And plus, knights get all the chicks!"
|
:ego "And plus, it's the only way to get Georgia McGorgeous to love me!"
|
||||||
:ego "And this plaque here says that chicks dig knights.")))
|
:ego "And this plaque here says that maidens love knights."
|
||||||
|
:fairy-godfather "As long as you're under my watch, Tick, I forbid it!"
|
||||||
|
:fairy-godfather "And you're just not cut out for it!")))
|
||||||
:broom (assoc (texture "dream/broom.png") :x 286 :y 122
|
:broom (assoc (texture "dream/broom.png") :x 286 :y 122
|
||||||
:path (catmull-rom-spline (map #(apply vector-2* %) [[286 122] [286 128]]) true)
|
:path (catmull-rom-spline (map #(apply vector-2* %) [[286 122] [286 128]]) true)
|
||||||
|
|
||||||
@@ -168,7 +177,14 @@
|
|||||||
:baseline 240
|
:baseline 240
|
||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(actions/walk-to entities :ego [267 70] :face :right)
|
(actions/walk-to entities :ego [267 70] :face :right)
|
||||||
(actions/talk entities :ego "So do I kill ghouls with this broom?")
|
(actions/talk entities :ego "There's a plaque here.")
|
||||||
|
(actions/play-animation entities :ego :squat)
|
||||||
|
(actions/do-dialogue entities
|
||||||
|
:ego "'Grab the broom, and sweep that dirt!\nSweep, and mop till your arms hurt.'"
|
||||||
|
:ego "'You'll smell like a hog,\nwith stench like a fog,'"
|
||||||
|
:ego "'So with you, no girl will flirt.'")
|
||||||
|
(actions/play-animation entities :ego :sigh)
|
||||||
|
(actions/talk entities :ego "So can I at least slay ghouls with this broom?")
|
||||||
(actions/stop-walking entities :ego :face :left)
|
(actions/stop-walking entities :ego :face :left)
|
||||||
(actions/do-dialogue entities :fairy-godfather "Not quite, young Tick."
|
(actions/do-dialogue entities :fairy-godfather "Not quite, young Tick."
|
||||||
:fairy-godfather "This weapon is used to fight a more persistent foe."
|
:fairy-godfather "This weapon is used to fight a more persistent foe."
|
||||||
@@ -182,11 +198,17 @@
|
|||||||
:baseline 240
|
:baseline 240
|
||||||
:script (actions/get-script entities
|
:script (actions/get-script entities
|
||||||
(actions/walk-to entities :ego [61 72] :face :left)
|
(actions/walk-to entities :ego [61 72] :face :left)
|
||||||
(actions/talk entities :ego "A shovel?")
|
(actions/talk entities :ego "There's a plaque here.")
|
||||||
(actions/stop-walking entities :ego :face :right)
|
(actions/play-animation entities :ego :squat)
|
||||||
(actions/do-dialogue entities :fairy-godfather "That's right, young Tick!"
|
(actions/do-dialogue entities
|
||||||
:fairy-godfather "A grave-digger is a noble profession!"
|
:ego "'Choose the shovel, dig some holes,\ntis the boringest of roles,'"
|
||||||
:fairy-godfather "Take the shovel, and cast it into the pit of fate.")))
|
:ego "'You can work by night,\nBut suffer a plight:'"
|
||||||
|
:ego "'Gals dislike guys who bury souls.'")
|
||||||
|
(actions/play-animation entities :ego :sigh)
|
||||||
|
(actions/do-dialogue entities
|
||||||
|
:fairy-godfather "Don't be dismayed, young Tick."
|
||||||
|
:fairy-godfather "Remember, these destinies can't be mistaken."
|
||||||
|
:ego "But it sounds so dull!")))
|
||||||
:sign (assoc (texture "dream/sign.png") :x 229 :y 33 :baseline 207)
|
:sign (assoc (texture "dream/sign.png") :x 229 :y 33 :baseline 207)
|
||||||
:fairy-godfather (assoc (animation->texture screen fairy-godfather-anim)
|
:fairy-godfather (assoc (animation->texture screen fairy-godfather-anim)
|
||||||
:x 200 :y 130
|
:x 200 :y 130
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
[advent.screens.rooms.outside-castle :as outside-castle]
|
[advent.screens.rooms.outside-castle :as outside-castle]
|
||||||
[advent.screens.rooms.inside-castle :as inside-castle]
|
[advent.screens.rooms.inside-castle :as inside-castle]
|
||||||
[advent.actions :as actions]
|
[advent.actions :as actions]
|
||||||
|
[advent.tween :as tween]
|
||||||
[advent.utils :as utils]
|
[advent.utils :as utils]
|
||||||
[clojure.zip :as zip]
|
[clojure.zip :as zip]
|
||||||
[play-clj.core :refer :all]
|
[play-clj.core :refer :all]
|
||||||
@@ -256,6 +257,78 @@
|
|||||||
(assoc-in entities [:room :entities :lamb :target-x] (rand-nth [30 10 60 70]))
|
(assoc-in entities [:room :entities :lamb :target-x] (rand-nth [30 10 60 70]))
|
||||||
entities)))
|
entities)))
|
||||||
|
|
||||||
|
|
||||||
|
(defn glad [entities]
|
||||||
|
(actions/run-action entities
|
||||||
|
(begin [this screen entities]
|
||||||
|
(let [current-y (get-in entities [:room :entities :ego :y])
|
||||||
|
to-y (+ current-y 15)]
|
||||||
|
(-> entities
|
||||||
|
(update-in [:room :entities :ego] #(actions/start-animation screen % :glad) )
|
||||||
|
(assoc-in [:tweens :jump] (tween/tween :jump screen [:room :entities :ego :y] current-y to-y 0.3 :ease tween/ease-out-cubic))
|
||||||
|
(assoc-in [:room :entities :glad-jump] (doto (assoc (particle-effect "ego/glad-jump")
|
||||||
|
:x (get-in entities [:room :entities :ego :x])
|
||||||
|
:y (get-in entities [:room :entities :ego :y])
|
||||||
|
:baseline (get-in entities [:room :entities :ego :baseline]))
|
||||||
|
(particle-effect! :reset) (particle-effect! :start)))
|
||||||
|
(assoc-in [:room :entities :cloud] (assoc (texture "space/cloud.png")
|
||||||
|
:x (get-in entities [:room :entities :ego :x])
|
||||||
|
:y (get-in entities [:room :entities :ego :y])
|
||||||
|
:origin-x 7
|
||||||
|
:origin-y 7
|
||||||
|
:scale-x 0.5
|
||||||
|
:scale-y 0.5
|
||||||
|
:opacity 0.5
|
||||||
|
:baseline 240))
|
||||||
|
(assoc-in [:tweens :cloud-up] (tween/tween :cloud-up screen [:room :entities :cloud :y]
|
||||||
|
(get-in entities [:room :entities :ego :y])
|
||||||
|
(+ (get-in entities [:room :entities :ego :y]) 10)
|
||||||
|
1.0))
|
||||||
|
(assoc-in [:tweens :cloud-fade] (tween/tween :cloud-fade screen [:room :entities :cloud :opacity]
|
||||||
|
0.5
|
||||||
|
0.0
|
||||||
|
1.0))
|
||||||
|
(assoc-in [:tweens :cloud-grow] (tween/tween :cloud-grow screen [:room :entities :cloud :scale-y]
|
||||||
|
0.5
|
||||||
|
1.0
|
||||||
|
1.0))
|
||||||
|
(assoc-in [:tweens :cloud-grow-2] (tween/tween :cloud-grow-2 screen [:room :entities :cloud :scale-x]
|
||||||
|
0.5
|
||||||
|
1.0
|
||||||
|
1.0)))))
|
||||||
|
|
||||||
|
(continue [this screen entities]
|
||||||
|
(assoc-in entities [:room :entities :glad-jump :y] (+ (get-in entities [:room :entities :ego :y]) 5))
|
||||||
|
)
|
||||||
|
|
||||||
|
(done? [this screen entities]
|
||||||
|
(nil? (get-in entities [:tweens :jump])))
|
||||||
|
|
||||||
|
(terminate [this screen entities]
|
||||||
|
entities)
|
||||||
|
(can-skip? [this screen entities]
|
||||||
|
false))
|
||||||
|
(Thread/sleep 800)
|
||||||
|
(actions/run-action entities
|
||||||
|
(begin [this screen entities]
|
||||||
|
(let [current-y (get-in entities [:room :entities :ego :y])
|
||||||
|
to-y (- current-y 15)]
|
||||||
|
(-> entities
|
||||||
|
(assoc-in [:tweens :jump] (tween/tween :jump screen [:room :entities :ego :y] current-y to-y 0.3 :ease tween/ease-in-cubic)))))
|
||||||
|
|
||||||
|
(continue [this screen entities] entities)
|
||||||
|
|
||||||
|
(done? [this screen entities]
|
||||||
|
(and (nil? (get-in entities [:tweens :jump]))
|
||||||
|
(animation! (actions/find-animation (get-in entities [:room :entities :ego ]) :glad)
|
||||||
|
:is-animation-finished
|
||||||
|
(- (:total-time screen) (get-in entities [:room :entities :ego :anim-start])))))
|
||||||
|
|
||||||
|
(terminate [this screen entities]
|
||||||
|
entities)
|
||||||
|
(can-skip? [this screen entities]
|
||||||
|
false)))
|
||||||
|
|
||||||
(defn make [screen]
|
(defn make [screen]
|
||||||
(let [sheep-stand-sheet (texture! (texture "outsidehouse/sheep-anim.png") :split 33 21)
|
(let [sheep-stand-sheet (texture! (texture "outsidehouse/sheep-anim.png") :split 33 21)
|
||||||
sheep-walk-sheet (texture! (texture "outsidehouse/sheep-walk.png") :split 33 21)
|
sheep-walk-sheet (texture! (texture "outsidehouse/sheep-walk.png") :split 33 21)
|
||||||
@@ -339,7 +412,8 @@
|
|||||||
(actions/talk entities :ego "I guess her wool is shedding."))
|
(actions/talk entities :ego "I guess her wool is shedding."))
|
||||||
(do
|
(do
|
||||||
(actions/talk entities :ego "Come here mama sheep!")
|
(actions/talk entities :ego "Come here mama sheep!")
|
||||||
(actions/play-animation entities :ego :sigh)
|
(glad entities)
|
||||||
|
|
||||||
(actions/talk entities :ego "She's too far away for me to pet her.")))))
|
(actions/talk entities :ego "She's too far away for me to pet her.")))))
|
||||||
:scripts #(condp = %
|
:scripts #(condp = %
|
||||||
:wool (actions/get-script entities
|
:wool (actions/get-script entities
|
||||||
|
|||||||
@@ -197,6 +197,7 @@
|
|||||||
scared-talk (utils/make-anim "ego/scared.png" [18 36] 0.05 [0 1 0 1 0 1 0 1 2 3 2 3 2 3 2 3])
|
scared-talk (utils/make-anim "ego/scared.png" [18 36] 0.05 [0 1 0 1 0 1 0 1 2 3 2 3 2 3 2 3])
|
||||||
scared-walk (utils/make-anim "ego/scared-walk.png" [16 36] 0.05 (range 6))
|
scared-walk (utils/make-anim "ego/scared-walk.png" [16 36] 0.05 (range 6))
|
||||||
sigh (utils/make-anim "ego/sigh.png" [18 36] 0.08 [0 0 0 0 1 1 1 2 3 4 5 6 7 8 8 8 8 8 8 8 8 8 0 0 0 0 ])
|
sigh (utils/make-anim "ego/sigh.png" [18 36] 0.08 [0 0 0 0 1 1 1 2 3 4 5 6 7 8 8 8 8 8 8 8 8 8 0 0 0 0 ])
|
||||||
|
glad (utils/make-anim "ego/glad.png" [20 46] 0.04 (flatten [0 1 2 3 4 (repeat 10 [5 5 6]) (repeat 20 0)]))
|
||||||
|
|
||||||
ego {:right {:walk walk-right
|
ego {:right {:walk walk-right
|
||||||
:stand stand-anim
|
:stand stand-anim
|
||||||
@@ -231,7 +232,8 @@
|
|||||||
:scared scared
|
:scared scared
|
||||||
:scared-talk scared-talk
|
:scared-talk scared-talk
|
||||||
:scared-walk scared-walk
|
:scared-walk scared-walk
|
||||||
:sigh sigh}
|
:sigh sigh
|
||||||
|
:glad glad}
|
||||||
:left {:walk (utils/flip walk-right)
|
:left {:walk (utils/flip walk-right)
|
||||||
:stand (utils/flip stand-anim)
|
:stand (utils/flip stand-anim)
|
||||||
:talk (utils/flip talk-anim)
|
:talk (utils/flip talk-anim)
|
||||||
@@ -256,7 +258,8 @@
|
|||||||
[:fire 3] (utils/flip fire-3-anim)
|
[:fire 3] (utils/flip fire-3-anim)
|
||||||
:spear (utils/flip spear)
|
:spear (utils/flip spear)
|
||||||
:pant (utils/flip pant)
|
:pant (utils/flip pant)
|
||||||
:sigh (utils/flip sigh)}
|
:sigh (utils/flip sigh)
|
||||||
|
:glad (utils/flip glad)}
|
||||||
:baseline (- 240 (last start-pos))
|
:baseline (- 240 (last start-pos))
|
||||||
:facing :right
|
:facing :right
|
||||||
:origin-x 9
|
:origin-x 9
|
||||||
|
|||||||
@@ -35,6 +35,14 @@
|
|||||||
(- (* t t t t) 2))
|
(- (* t t t t) 2))
|
||||||
start)))))
|
start)))))
|
||||||
|
|
||||||
|
(defn ease-out-quadratic [t start delta duration]
|
||||||
|
(let [t (/ t duration)]
|
||||||
|
(+ (* (- delta) t (- t 2)) start)))
|
||||||
|
|
||||||
|
(defn ease-out-cubic [t start delta duration]
|
||||||
|
(let [t (dec (/ t duration))]
|
||||||
|
(+ (* delta (inc (* t t t))) start)))
|
||||||
|
|
||||||
(defn tween [id screen path start end duration & {:keys [finish ease]}]
|
(defn tween [id screen path start end duration & {:keys [finish ease]}]
|
||||||
(let [ease (or ease ease-linear)
|
(let [ease (or ease ease-linear)
|
||||||
finish (or finish identity)
|
finish (or finish identity)
|
||||||
|
|||||||
Reference in New Issue
Block a user