closer to supporting toss.
This commit is contained in:
BIN
desktop/resources/castle-gate/throw-walkie.png
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.0 KiB |
BIN
desktop/resources/castle-gate/throw-walkie.pxa/0.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/1.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/2.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/3.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/4.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/4.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/5.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/5.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/6.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/6.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/7.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/7.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/castle-gate/throw-walkie.pxa/8.pxi
Normal file
BIN
desktop/resources/castle-gate/throw-walkie.pxa/8.pxi
Normal file
Binary file not shown.
42
desktop/resources/castle-gate/throw-walkie.pxa/CelData.plist
Normal file
42
desktop/resources/castle-gate/throw-walkie.pxa/CelData.plist
Normal file
@@ -0,0 +1,42 @@
|
||||
<?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>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>1</real>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
@@ -120,40 +120,60 @@
|
||||
|
||||
|
||||
(defn make [screen]
|
||||
(rooms/make :music {:day :town-2 :night :night}
|
||||
:interactions {:right-dir {:box [300 40 320 83]
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [301 46] :face :right)
|
||||
(actions/walk-straight-to entities :ego [340 40])
|
||||
(actions/transition-background entities :outside-castle [82 180])
|
||||
(actions/walk-to entities :ego [129 148]))
|
||||
:cursor :right}
|
||||
:left-dir {:box [105 93 169 212]
|
||||
:script (actions/get-script entities (attempt-walking-through-gate entities))
|
||||
:cursor :left}
|
||||
:big-tree {:box [20 10 82 235]
|
||||
:scripts {:walkie-talkies (actions/get-script entities (drop-walkie-talkie entities))}}
|
||||
:window {:box [192 157 215 215]
|
||||
:script (actions/get-script entities
|
||||
(actions/do-dialogue entities :ego "It's a big window!"))
|
||||
:scripts {:walkie-talkies (actions/get-script entities
|
||||
(actions/walk-to entities :ego [285 71])
|
||||
(actions/walk-straight-to entities :ego [308 115] :face :left)
|
||||
(actions/play-animation entities :ego :throw)
|
||||
(actions/remove-item entities :walkie-talkies)
|
||||
(actions/walk-straight-to entities :ego [285 71]))}}}
|
||||
|
||||
:layers {:day [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]
|
||||
:night [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]}
|
||||
:entities {:frankie (make-frankie screen)
|
||||
:goon-1 (make-goon-1 screen)
|
||||
:goon-2 (make-goon-2 screen)}
|
||||
|
||||
:collision "castle-gate/collision.png"
|
||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.30)
|
||||
:apply-state (fn [entities]
|
||||
(as-> entities entities
|
||||
(if (= :night (get-in entities [:state :time]))
|
||||
(make-night entities)
|
||||
entities)))
|
||||
:start-pos [300 45]))
|
||||
(let [throw-walkie (utils/make-anim "castle-gate/throw-walkie.png" [205 136] 0.1 (flatten [(repeat 55 0) (range 9) (repeat 55 8)]))
|
||||
walkie-base (animation 1.0 [(last (utils/split-texture "castle-gate/throw-walkie.png" [205 136] (range 9)))])]
|
||||
(rooms/make :music {:day :town-2 :night :night}
|
||||
:interactions {:right-dir {:box [300 40 320 83]
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [301 46] :face :right)
|
||||
(actions/walk-straight-to entities :ego [340 40])
|
||||
(actions/transition-background entities :outside-castle [82 180])
|
||||
(actions/walk-to entities :ego [129 148]))
|
||||
:cursor :right}
|
||||
:left-dir {:box [105 93 169 212]
|
||||
:script (actions/get-script entities (attempt-walking-through-gate entities))
|
||||
:cursor :left}
|
||||
|
||||
:big-tree {:box [20 10 82 235]
|
||||
:scripts {:walkie-talkies (actions/get-script entities (drop-walkie-talkie entities))}}
|
||||
:window {:box [192 157 215 215]
|
||||
:script (actions/get-script entities
|
||||
(actions/walk-to entities :ego [285 71])
|
||||
(actions/walk-straight-to entities :ego [308 105] :face :left)
|
||||
(actions/begin-animation entities :throw-walkie :throw-walkie)
|
||||
(actions/play-animation entities :ego :throw)
|
||||
(actions/begin-animation entities :throw-walkie :stand)
|
||||
(Thread/sleep 2000)
|
||||
(actions/walk-straight-to entities :ego [285 71]))
|
||||
:scripts {:walkie-talkies (actions/get-script entities
|
||||
(actions/walk-to entities :ego [285 71])
|
||||
(actions/walk-straight-to entities :ego [308 105] :face :left)
|
||||
(actions/begin-animation entities :throw-walkie :throw-walkie)
|
||||
(actions/play-animation entities :ego :throw)
|
||||
(actions/remove-item entities :walkie-talkies)
|
||||
(actions/begin-animation entities :throw-walkie :stand)
|
||||
(Thread/sleep 2000)
|
||||
(actions/walk-straight-to entities :ego [285 71]))}}}
|
||||
|
||||
:layers {:day [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]
|
||||
:night [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]}
|
||||
:entities {:frankie (make-frankie screen)
|
||||
:goon-1 (make-goon-1 screen)
|
||||
:goon-2 (make-goon-2 screen)
|
||||
:throw-walkie (assoc (animation->texture screen walkie-base)
|
||||
:x 104 :y 88
|
||||
:baseline 130
|
||||
|
||||
:throw-walkie throw-walkie
|
||||
:stand walkie-base
|
||||
:anim-start 0
|
||||
:anim walkie-base)}
|
||||
|
||||
:collision "castle-gate/collision.png"
|
||||
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.30)
|
||||
:apply-state (fn [entities]
|
||||
(as-> entities entities
|
||||
(if (= :night (get-in entities [:state :time]))
|
||||
(make-night entities)
|
||||
entities)))
|
||||
:start-pos [300 45])))
|
||||
|
||||
@@ -357,7 +357,7 @@ void main()
|
||||
glad (utils/make-anim "ego/glad.png" [20 46] 0.04 (flatten [0 1 2 3 4 (repeat 8 [5 5 5]) (repeat 20 0)]))
|
||||
milk (utils/make-anim "ego/squat.png" [18 36] 0.05 [0 1 2 2 3 3 3 3 3 3 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 6 5 3 3 3 3 3 3 3 3 3 3 3 2 1 0])
|
||||
idea (utils/make-anim "ego/idea.png" [18 70] 0.3 [2 0 0 0 0 0 0 2])
|
||||
throw (utils/make-anim "ego/throw.png" [18 36] 0.04 (flatten [[(repeat 5 0) (repeat 10 1)] (repeat 3 [2 2 2 3 3 3 4 4 4 5 5 5]) (repeat 5 [2 2 3 3 4 4 5 5]) (repeat 10 [2 3 4 5]) [2 3 3] (repeat 15 6)]))
|
||||
throw (utils/make-anim "ego/throw.png" [18 36] 0.04 (flatten [[(repeat 5 0) (repeat 10 1)] (repeat 3 [2 2 2 3 3 3 4 4 4 5 5 5]) (repeat 5 [2 2 3 3 4 4 5 5]) (repeat 10 [2 3 4 5]) [2 3 3] (repeat 33 6)]))
|
||||
swing-shovel (utils/make-anim "ego/swing-shovel.png" [70 70] 0.1 (range 9))
|
||||
love (utils/make-anim "ego/love.png" [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]))
|
||||
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)]))
|
||||
|
||||
@@ -117,10 +117,15 @@
|
||||
(texture! frame :flip true false)
|
||||
frame))))
|
||||
|
||||
(defn make-anim [file [w h] speed frames]
|
||||
(defn split-texture [file [w h] frames]
|
||||
(let [sheet (texture! (texture file) :split w h)]
|
||||
(animation speed (for [i frames]
|
||||
(aget sheet 0 i)))))
|
||||
(for [i frames]
|
||||
(aget sheet 0 i))))
|
||||
|
||||
(defn make-anim [file [w h] speed frames]
|
||||
(animation speed (split-texture file [w h] frames)))
|
||||
|
||||
|
||||
(defn make-bird [screen p]
|
||||
(let [bird-sheet (texture! (texture "outside-castle/bird.png") :split 1 2)
|
||||
bird-stand (animation 0.15 (for [i [0 1]]
|
||||
|
||||
Reference in New Issue
Block a user