Added jail

This commit is contained in:
2014-12-24 14:21:37 -08:00
parent 4e6a0b82da
commit adfb4d0a3d
7 changed files with 35 additions and 9 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@@ -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]))

View File

@@ -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)

View File

@@ -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