first puzzle complete

This commit is contained in:
2014-09-28 14:52:05 -07:00
parent fbbc7519a8
commit 4bd400dff3
3 changed files with 142 additions and 109 deletions

View File

@@ -19,8 +19,10 @@
(done? [this screen entities])
(continue [this screen entities])
(terminate [this screen entities])
(can-skip? [this screen entities])
(get-channel [this]))
(defmacro get-script [entities & forms]
`(fn [starting-entities#]
(let [~entities (atom starting-entities#)]
@@ -114,7 +116,9 @@
(< (dist final-x final-y from-x from-y) 1)))
(terminate [this screen entities]
(stop screen entities target-id)))
(stop screen entities target-id))
(can-skip? [this screen entities]
false))
@entities)))
(defn get-text-duration [text]
@@ -147,7 +151,9 @@
(run! dialogue/talking-screen :stop-talk :target-id target-id)
(if stop?
(stop screen entities target-id)
entities)))))
entities))
(can-skip? [this screen entities]
true))))
(defn something-else [zipper]
(-> zipper zip/up zip/up))
@@ -182,7 +188,9 @@
(terminate [this screen entities]
(run! @(resolve 'advent.screens.scene/scene) :on-reactivate)
entities))
entities)
(can-skip? [this screen entities]
false))
(let [zipper (nth-child zipper @selected-index)
node (zip/node zipper)]
@@ -195,6 +203,16 @@
(recur (next-choices zipper))
(recur zipper)))))))
(defn update-state [entities f]
(run-action entities
(begin [this screen entities]
(update-in entities [:state] f ))
(continue [this screen entities] entities)
(done? [this screen entities] true)
(terminate [this screen entities]
entities)
(can-skip? [this screen entities]
false)))
(defn give [entities target-id item]
(run-action entities
@@ -210,7 +228,9 @@
(done? [this screen entities] true)
(terminate [this screen entities]
entities)))
entities)
(can-skip? [this screen entities]
false)))
(defn transition-background [entities new-background [x y]]
(run-action entities
@@ -231,7 +251,9 @@
(>= (get-in entities [:transition :opacity]) 1.0))
(terminate [this screen entities]
entities))
entities)
(can-skip? [this screen entities]
false))
(run-action entities
(begin [this screen entities]
(let [ego (get-in entities [:background :entities :ego])
@@ -248,4 +270,7 @@
(<= (get-in entities [:transition :opacity]) 0.0))
(terminate [this screen entities]
(dissoc entities :transition))))
(dissoc entities :transition))
(can-skip? [this screen entities]
false)))