progresss on blergh fight.

This commit is contained in:
2015-01-08 22:24:13 -08:00
parent 3fe5071467
commit b89cf36e25
32 changed files with 121 additions and 12 deletions

View File

@@ -31,7 +31,8 @@
blergh-stand-anim (animation 0.7 [blergh-flex blergh-stand])
blergh-swing (utils/make-anim "space/blergh-swing.png" [106 165] 0.1 [0 0 1 2 3 4 ])
blergh-appear (utils/make-anim "space/blergh-appear.png" [106 165] 0.05 (flatten [(range 13) 12 12 12 12 12 12 12 12 12 12 12 12 12 ]))
blergh-grow (utils/make-anim "space/blergh-grow.png" [106 165] 0.10 [0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11]) ]
blergh-grow (utils/make-anim "space/blergh-grow.png" [106 165] 0.10 [0 1 0 1 0 1 0 1 1 1 1 0 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 2 2 2 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 2 3 3 3 3 3 3 3 3 3 3 2 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 4 4 5 6 7 8 9 10 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11 11])
bullet (utils/make-anim "space/bullet.png" [24 24] 0.0075 [0 1 2 0 1 2 0 1 2 0 1 2 0 1 2 3 3 3 4 4 5 5 6 5 4 7])]
(rooms/make :music :town-1
:interactions
{}
@@ -57,10 +58,34 @@
(common/go-to-jail entities)
(actions/do-dialogue entities :ego "Hey!"
:ego "What's going on? I was just about to teach Blergh a lesson!"))}))
:ego "What's going on? I was just about to teach Blergh a lesson!"))
:magic-slingshot (actions/get-script entities
(actions/do-dialogue entities
:ego "Hey Blergh!"
:ego "Take this!")
(actions/play-animation entities :ego :shoot)
(actions/add-entity entities :bullet (get-in @entities [:room :bullet]))
(actions/walk-straight-to entities :bullet [213 166] :update-baseline? false :speed 5.0)
(actions/add-entity entities :broken-jewel (get-in @entities [:room :broken-jewel]))
(Thread/sleep 500)
(actions/remove-entity entities :bullet)
(actions/update-state entities #(assoc % :broke-jewel? true))
(actions/do-dialogue entities
:blergh "Argh! My magic lightning helmet!"
:blergh "No matter. I will destroy you with my bare hands!"))}))
:entities {}
:bullet (assoc (animation->texture screen bullet)
:x 130 :y 85 :baseline 241
:walk bullet)
:broken-jewel (assoc (texture "space/broken-jewel.png")
:x 222 :y 172 :baseline 240)
:collision "space/collision.png"
:scale-fn (constantly 1.5)
:start-pos [43 80]
:start-pos [140 55]
:apply-state (fn [e]
(assoc-in e [:room :entities :blergh] (get-in e [:room :blergh]))))))
(as-> e e
(if (get-in e [:state :broke-jewel?])
(assoc-in e [:room :entities :broken-jewel] (get-in e [:room :entities :broken-jewel]))
e)
(assoc-in e [:room :entities :blergh] (get-in e [:room :blergh])))
))))