Files
gitea-docker/desktop/src-common/advent/screens/rooms/dream.clj
2015-01-20 07:15:17 -08:00

38 lines
1.5 KiB
Clojure

(ns advent.screens.rooms.dream
(:require
[clojure.core.async :as a]
[advent.screens.rooms :as rooms]
[advent.screens.rooms.common :as common]
[advent.actions :as actions]
[advent.screens.items :as items]
[advent.utils :as utils]
[clojure.zip :as zip]
[clojure.set :as set]
[clojure.string :as str]
[play-clj.core :refer :all]
[play-clj.ui :refer :all]
[play-clj.utils :refer :all]
[play-clj.g2d :refer :all]))
(def walk-chan (a/chan))
(defn do-intro [entities]
(a/go
(actions/do-dialogue entities
:ego "Oh hi there!"
:ego "I'm Faceplant, the great knight, and this is my dream!"
:ego "Just like in real life, I can walk around if you just click somewhere on the screen."
:ego "Give it a shot, whydontya?")
(actions/walk-to entities :ego [100 100])
(actions/talk entities :ego "I can also pick up stuff by clicking on it.")))
(defn make [screen]
(rooms/make :music :town-1
:interactions {:floor {:box [0 0 320 170]
:script (actions/get-script entities (a/>! [100 100]))}}
:layers [(assoc (texture "dream/background.png") :x 0 :y 0 :baseline 0)]
:entities {}
:collision "space/background.png"
:scale-fn (constantly 1.5)
:start-pos [140 55]))