This commit is contained in:
Bryce Covert
2017-05-31 20:00:33 -07:00
parent 6580bbb52b
commit 67cbac3dbd
42 changed files with 398 additions and 167 deletions

View File

@@ -699,7 +699,6 @@
(get-in ego [:right :talk] ) {2 [:blink 0.15]}
(get-in ego [:left :grow] ) {1 [:grow-sound 0.75]}
(get-in ego [:right :grow] ) {1 [:grow-sound 0.75]}
(get-in ego [:left :crowbar] ) {3 [:crowbar-sound 0.5]}
(get-in ego [:right :crowbar] ) {3 [:crowbar-sound 0.5]}
(get-in ego [:right :shoot] ) {14 [:shoot-sound 0.75]}
(get-in ego [:left :shoot] ) {14 [:shoot-sound 0.75]}
@@ -859,7 +858,6 @@
(get-looped-animation-point anim last-animated-time)
last-animated-time))]
(if (and (= current-frame-index (:current-frame-index entity) (:previous-frame-index entity))
(not (:force-rerender entity)))
entity
@@ -1356,6 +1354,7 @@
:pinch-stop
(fn [screen entities options]
(println "stopped pinching")
(when (get-in entities [:state :active?])
(-> entities
(remove-cam-tweens))))
@@ -1427,15 +1426,37 @@
interacting-entity (get-interacting-entity entities x y)]
(-> entities
(assoc-in [:cursor :depressed?] true)
(update-in [:cursor :counter] #(inc (or % 0)))
(update-in [:cursor :max-counter] #(inc (or % 0)))
(assoc-in [:cursor :down-target] (or (:id interacting-entity ) (:id interaction) nil)))))))
:on-touch-up (fn [screen entities options]
(println (input! :is-touched))
(println "touch up")
(log/info "touch up")
(handle-touch-up screen entities options))
(let [currently-pressed (dec (get-in entities [:cursor :counter]))
max-pressed (get-in entities [:cursor :max-counter])]
(println "touched up" currently-pressed max-pressed)
(cond
(and (<= currently-pressed 0)
(<= max-pressed 1))
(handle-touch-up screen
(-> entities
(assoc-in [:cursor :counter] 0)
(assoc-in [:cursor :max-counter] 0))
options)
(= currently-pressed 0)
(-> entities
(assoc-in [:cursor :counter] 0)
(assoc-in [:cursor :max-counter] 0))
(get-in entities [:state :active?])
(update-in entities [:cursor :counter] #(max 0 (dec %)))
:else
entities
)))
:on-tap (fn [screen entities options]
(println "tapping")
(when utils/mobile?
(handle-touch-up screen entities options)))
@@ -1982,6 +2003,8 @@
(assoc-in [:already-saved?] false)))
:on-reactivate
(fn [screen entities {:keys [script-started? item]}]
(let [selected-item? (and (:value item)
@@ -2031,7 +2054,7 @@
entities))))
:on-touch-up
:on-tap
(fn [screen entities options]
(if (= (button-code :left) (:button options))
(let [[x y] (utils/unproject screen options)]