45 lines
2.4 KiB
Clojure
45 lines
2.4 KiB
Clojure
(ns advent.screens.rooms.castle-gate
|
|
(: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-night [entities]
|
|
entities)
|
|
|
|
|
|
(defn make [screen]
|
|
(rooms/make :music {:day :town-2 :night :night}
|
|
:interactions {:right-dir {:box [300 40 320 83]
|
|
:script (actions/get-script entities
|
|
(actions/walk-to entities :ego [301 46] :face :right)
|
|
(actions/walk-straight-to entities :ego [340 40])
|
|
(actions/transition-background entities :outside-castle [82 180])
|
|
(actions/walk-to entities :ego [129 148]))
|
|
:cursor :right}
|
|
:left-dir {:box [105 93 169 212]
|
|
:script (actions/get-script entities
|
|
(actions/walk-straight-to entities :ego [157 83])
|
|
(actions/transition-background entities :inside-castle [280 145])
|
|
(actions/walk-to entities :ego [245 90]))
|
|
:cursor :left}}
|
|
|
|
:layers {:day [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]
|
|
:night [(assoc (texture "castle-gate/background.png") :x 0 :y 0 :baseline 0)]}
|
|
:entities {}
|
|
|
|
:collision "castle-gate/collision.png"
|
|
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.30)
|
|
:apply-state (fn [entities]
|
|
(as-> entities entities
|
|
(if (= :night (get-in entities [:state :time]))
|
|
(make-night entities)
|
|
entities)))
|
|
:start-pos [300 45]))
|