This commit is contained in:
2014-09-20 00:04:30 -07:00
4 changed files with 45 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@@ -170,7 +170,9 @@
:right-dir {:box [300 131 320 224]
:script (actions/get-script
entities
(actions/walk-to entities :ego [319 160]))
(actions/walk-to entities :ego [244 150])
(actions/transition-background entities :behind-house [122 140])
(actions/walk-to entities :ego [172 122]))
:cursor :right}
:up-dir {:box [60 180 224 240]
:script (actions/get-script
@@ -181,7 +183,7 @@
:script (actions/get-script
entities
(actions/walk-to entities :ego [0 80])
(actions/transition-background entities :behind-house [310 80]))
(actions/transition-background entities :outside-castle [310 80]))
:cursor :left}}
:layers [(assoc (texture "bg5.png") :x 0 :y 0 :baseline 0)
(assoc (texture "house.png") :x 0 :y 0 :baseline 122)
@@ -192,8 +194,44 @@
sheep)}
:collision "outsidehouse/collision.png"
:scale-fn (scaler-fn-with-baseline 110 0.10 1.00))
:behind-house
(make-background :interactions
{:left-dir {:box [0 131 20 224]
:script (actions/get-script
entities
(actions/walk-to entities :ego [122 140])
(actions/transition-background entities :outside-house [244 150])
(actions/walk-to entities :ego [195 140]))
:cursor :left}
:crack {:box [68 100 73 114]
:script (actions/get-script
entities
(actions/walk-to entities :ego [70 80])
(actions/talk entities :ego "I can see Fangald, the wizard inside.")
(actions/talk entities :ego "It looks like he's opening his Magi-safe.")
(actions/talk entities :ego "[todo: sounds play.]")
(actions/talk entities :ego "A lot of good it'll do me to know his password while he's still there."))}
:mushrooms {:box [247 59 269 76]
:script (actions/get-script
entities
(if ((get-in @entities [:background :entities :ego :inventory]) :mushrooms)
(actions/talk entities :ego "I've already got a junk ton of mushrooms.")
(do
(actions/walk-to entities :ego [242 75])
(actions/give entities :ego :mushrooms)
(actions/talk entities :ego "Perfectly ripe mushrooms!"))))}
:window {:box [103 44 130 140]
:script (actions/get-script
entities
(actions/walk-to entities :ego [128 100])
(actions/talk entities :ego "I can see Fangald moving around in there but it's hard to see at this angle."))}}
:layers [(assoc (texture "behindhouse/background.png") :x 0 :y 0 :baseline 0)
(assoc (texture "behindhouse/house.png") :x 0 :y 0 :baseline 122)
(assoc (texture "behindhouse/brush.png") :x 0 :y 0 :baseline 240)]
:entities {}
:collision "behindhouse/collision.png"
:scale-fn (scaler-fn-with-baseline 110 0.10 1.00))
:outside-castle
(make-background :interactions
{:right-dir {:box [300 40 320 140]
:script (actions/get-script
@@ -214,7 +252,7 @@
(actions/talk entities :peddler "...glass eyes, motivational tapes... " :stop? false)
(actions/talk entities :peddler "...and useful books like this:" :stop? false)
(actions/talk entities :peddler "'Checkers Mastery in Less Than 10 Seconds'")
(actions/talk entities :ego "I sure ami interested on that book on checkers.")
(actions/talk entities :ego "I sure am interested on that book on checkers.")
(actions/talk entities :peddler "An excellent selection! It is the choicest of checkers book you'll ever find." :stop? false)
(actions/talk entities :peddler "This book will only set you back 75 sheckels.")
(actions/talk entities :ego "But I haven't got any money!")
@@ -235,7 +273,7 @@
(fn [screen entities]
(update! screen :renderer (stage) :camera (orthographic))
(let [_ (input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
music (sound "town-music.mp3")
music (sound "town-music.mp3")
_ (sound! music :loop 0.20)
backgrounds (backgrounds screen)]
{:backgrounds backgrounds
@@ -249,8 +287,7 @@
:override nil}
:background (assoc-in (:outside-house backgrounds)
[:entities :ego] (get-ego screen))
:fps (assoc (label "0" (color :white) ) :x 5 :baseline 9000)
}))
:fps (assoc (label "0" (color :white) ) :x 5 :baseline 9000)}))
:on-render
(fn [screen [entities]]

View File

@@ -11,7 +11,7 @@
(let [{:keys [x y]} (input->screen screen {:x (:input-x screen) :y (:input-y screen)})]
(println (:input-x screen) (:input-y screen) "->" x y)))
(def +all-cursors+ [:main :wool :look :talk :right :down :left :up])
(def +all-cursors+ [:main :wool :mushrooms :talk :right :down :left :up])
(defn cursor [filename which]
(let [scale 2