Files
gitea-docker/desktop/src-common/advent/screens/rooms/behind_house.clj
2014-10-30 11:17:13 -07:00

63 lines
4.0 KiB
Clojure

(ns advent.screens.rooms.behind-house
(:require [advent.screens.rooms :as rooms]
[advent.screens.items :as items]
[advent.actions :as actions]
[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 :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/play-animation entities :ego :squat)
(actions/talk entities :ego "I can see Gandarf, the wizard inside.")
(actions/play-animation entities :ego :squat)
(actions/talk entities :ego "It looks like he's opening his Magi-safe.")
(actions/play-animation entities :ego :squat)
(actions/talk entities :ego "[todo: sounds play.]")
(actions/play-animation entities :ego :squat)
(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 (actions/has-item? @entities items/mushrooms)
(actions/talk entities :ego "I've already got a junk ton of mushrooms.")
(do
(actions/walk-to entities :ego [242 75])
(actions/play-animation entities :ego :squat)
(actions/give entities items/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 {:stick (assoc (texture "behindhouse/stick.png")
:x 26 :y 80 :baseline 160
:script (actions/get-script entities
(actions/walk-to entities :ego [50 80])
(actions/play-animation entities :ego :reach)
(actions/remove-entity entities :stick)
(actions/give entities items/stick)
(actions/talk entities :ego "This stick might be useful.")
))}
:collision "behindhouse/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)))