diff --git a/desktop/resources/inside-jail/bars-.png b/desktop/resources/inside-jail/bars-.png new file mode 100644 index 00000000..6a0995b6 Binary files /dev/null and b/desktop/resources/inside-jail/bars-.png differ diff --git a/desktop/resources/inside-jail/bars.png b/desktop/resources/inside-jail/bars.png new file mode 100644 index 00000000..abebeaa6 Binary files /dev/null and b/desktop/resources/inside-jail/bars.png differ diff --git a/desktop/resources/inside-jail/collision.png b/desktop/resources/inside-jail/collision.png new file mode 100644 index 00000000..b169d100 Binary files /dev/null and b/desktop/resources/inside-jail/collision.png differ diff --git a/desktop/resources/inside-jail/warden.png b/desktop/resources/inside-jail/warden.png new file mode 100644 index 00000000..c6577c0c Binary files /dev/null and b/desktop/resources/inside-jail/warden.png differ diff --git a/desktop/src-common/advent/screens/rooms/inside_jail.clj b/desktop/src-common/advent/screens/rooms/inside_jail.clj new file mode 100644 index 00000000..8f372996 --- /dev/null +++ b/desktop/src-common/advent/screens/rooms/inside_jail.clj @@ -0,0 +1,26 @@ +(ns advent.screens.rooms.inside-jail + (:require [advent.screens.rooms :as rooms] + [advent.actions :as actions] + [advent.screens.items :as items] + [advent.utils :as utils] + [clojure.zip :as zip] + [play-clj.core :refer :all] + [play-clj.ui :refer :all] + [play-clj.utils :refer :all] + [play-clj.g2d :refer :all])) + + +(defn make [screen] + (rooms/make :music :inside-antique + :interactions {} + :layers [(assoc (texture "inside-jail/background.png") :x 0 :y 0 :baseline 0) + (assoc (texture "inside-jail/bars.png") :x 0 :y 0 :baseline 165)] + :entities {:warden (assoc (texture "inside-jail/warden.png" ) + :x 40 :y 60 :baseline 166 + :talk-color (color 0.9 0.3 0.9 1.0) + :script (actions/get-script entities + (actions/do-dialogue entities :ego "Hey, who are you? Why am I in this cell?" + :warden "You're under arrest for theft of public property.")))} + :collision "inside-jail/collision.png" + :scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5) + :start-pos [130 85])) diff --git a/desktop/src-common/advent/screens/rooms/space.clj b/desktop/src-common/advent/screens/rooms/space.clj index d3fa98db..ed1582ec 100644 --- a/desktop/src-common/advent/screens/rooms/space.clj +++ b/desktop/src-common/advent/screens/rooms/space.clj @@ -52,7 +52,8 @@ (actions/play-animation entities :blergh :swing) (actions/walk-straight-to entities :ego [100 45] :anim :squat :override-dir :right :speed 3.0) (actions/do-dialogue entities :ego "Ouch!" - :blergh "Why don't you try that again?"))})) + :blergh "My turn.") + (actions/transition-background entities :inside-jail [100 100]))})) :entities {} :collision "space/collision.png" :scale-fn (constantly 1.5) diff --git a/desktop/src-common/advent/screens/scene.clj b/desktop/src-common/advent/screens/scene.clj index 63b78df0..93647ca0 100644 --- a/desktop/src-common/advent/screens/scene.clj +++ b/desktop/src-common/advent/screens/scene.clj @@ -17,6 +17,7 @@ [advent.screens.rooms.outside-house :as rooms.outside-house] [advent.screens.rooms.inside-house :as rooms.inside-house] [advent.screens.rooms.inside-castle :as rooms.inside-castle] + [advent.screens.rooms.inside-jail :as rooms.inside-jail] [advent.screens.rooms.inside-cafeteria :as rooms.inside-cafeteria] [advent.screens.rooms.inside-antique :as rooms.inside-antique] [advent.screens.rooms.behind-house :as rooms.behind-house] @@ -85,7 +86,7 @@ ((:get-script default-interaction) (get-in entities [:cursor :current]) [x y])) entities)) entities)))) -(defn drink-blergh [entities] +#_(defn drink-blergh [entities] (actions/walk-straight-to entities :ego [205 45]) (sound! (sound "ego/potion.ogg") :play) (actions/play-animation entities :ego :grow :stop? false) @@ -215,13 +216,10 @@ :get-script (fn [cursor [x y]] (condp = (:value cursor) :flask-1-with-cream-of-mushroom (actions/get-script entities (actions/talk entities :ego "Blegh! Gross!")) - :flask-1-strength (actions/get-script entities - (if (get-in @entities [:room :entities :blergh]) - (drink-blergh entities) - (do - (actions/talk entities :ego "I'll just take a sip!") - (sound! (sound "ego/potion.ogg") :play) - (actions/play-animation entities :ego :grow :stop? false)))) + :flask-1-strength (actions/get-script entities + (actions/talk entities :ego "I'll just take a sip!") + (sound! (sound "ego/potion.ogg") :play) + (actions/play-animation entities :ego :grow :stop? false)) :recipe (actions/get-script entities (actions/do-dialogue entities :ego "The recipe says:" :ego "'For strength beyond measure,\nyou must mix, at your leisure:'" @@ -307,6 +305,7 @@ :space (rooms.space/make screen) :inside-cafeteria (rooms.inside-cafeteria/make screen) :inside-antique (rooms.inside-antique/make screen) + :inside-jail (rooms.inside-jail/make screen) :outside-castle (rooms.outside-castle/make screen)} entities {:rooms rooms :musics {:object nil