working on held.

This commit is contained in:
2015-05-11 07:45:27 -07:00
parent f4dcf19b53
commit ff8a38c246
26 changed files with 1093 additions and 19 deletions

View File

@@ -88,7 +88,7 @@
:bird (utils/make-bird screen [[50 235] [80 220] [100 239] [180 235] [85 225]])}
:collision "behindhouse/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (get-in entities [:state :opened-crack?])
(assoc-in entities [:room :entities :peeling :opacity] 0)

View File

@@ -174,7 +174,7 @@
:collision "castle-gate/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.30)
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (= :night (get-in entities [:state :time]))
(make-night entities)

View File

@@ -329,7 +329,7 @@
nil)))
:collision "cat-tree/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.20)
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (actions/has-item? entities :kiss)
(update-in entities [:room :entities] #(dissoc % :cat))

View File

@@ -436,7 +436,7 @@
(actions/play-animation entities :ego :sigh))})}
:collision "dream/collision.png"
:scale-fn (utils/scaler-fn-from-image "dream/scale.png" 0.1 1.3)
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (get-in entities [:state :seen-intro?])
(set-opacity entities 1.0 1.0)

View File

@@ -0,0 +1,29 @@
(ns advent.screens.rooms.held
(:require [advent.screens.rooms :as rooms]
[advent.screens.rooms.common :as common]
[advent.actions :as actions]
[advent.screens.items :as items]
[advent.utils :as utils]
[advent.tween :as tween]
[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.math :refer :all]
[play-clj.g2d :refer :all]))
(defn make [screen]
(rooms/make :music :fight
:interactions {}
:layers [(assoc (texture "held/background.png") :x 0 :y 0 :baseline 0)]
:entities {}
:collision "held/collision.png"
:scale-fn (constantly 1.5)
:start-pos [113 120]
:apply-state (fn [screen e]
(-> e
(assoc-in [:cam :paused? ] true)
(update-in [:tweens] dissoc :cam-x :cam-y)
(update-in [:room :entities :ego] #(actions/start-animation screen % :suspended))))))

View File

@@ -220,7 +220,7 @@
(actions/talk entities :shopkeep "Since you ate the last one, you have to go tell Gandarf to bring me some more."))))))
:teddy teddy}
:collision "inside-antique/collision.png"
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (or (actions/has-item? entities :teddy)
(actions/has-obtained? entities :balloon))

View File

@@ -211,7 +211,7 @@
:win hands-fight-win
:lose hands-fight-lose)
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.3)
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (actions/has-item? entities :ladder)
(update-in entities [:room :entities] #(dissoc % :ladder))

View File

@@ -475,7 +475,7 @@
:chorus {:sound (sound "inside-castle/chorus.wav")}
:collision "inside-castle/collision.png"
:scale-fn (utils/scaler-fn-from-image "inside-castle/scale.png" 0.25 1.00)
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (actions/has-obtained? entities :trophy)
(update-in entities [:room :entities] #(dissoc % :trophy))

View File

@@ -203,7 +203,7 @@
:baseline 225))
:collision "inside-house/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.75)
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(particle-effect! (get-in entities [:room :entities :candle-smoke] ) :reset)
(particle-effect! (get-in entities [:room :entities :candle-smoke] ) :start)

View File

@@ -319,7 +319,7 @@
:collision-free (advent.pathfind/map-from-resource "inside-jail/collision-free.png")
:scale-fn (utils/scaler-fn-with-baseline 0 0.50 1.5)
:start-pos [130 85]
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (actions/has-obtained? entities :ball-n-chain)
(update-in entities [:room :entities] #(dissoc % :ball-n-chain))

View File

@@ -69,7 +69,7 @@
:collision "inside-stash/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:start-pos [143 96]
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(if (get-in entities [:state :broke-lock?])
(update-in entities [:room :entities] #(dissoc % :lid))
entities))))

View File

@@ -394,7 +394,7 @@
:collision "outside-castle/collision.png"
:scale-fn (utils/scaler-fn-from-image "outside-castle/scale-map.png" 0.20 1.00)
:start-pos [310 80]
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(if (#{:night :sunrise} (get-in entities [:state :time]))
(make-night entities)
entities)))))

View File

@@ -504,7 +504,7 @@
(common/read-note-1 entities))))
:collision "outsidehouse/collision.png"
:scale-fn scaler
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (get-in entities [:state :coaxed-sheep?])
(let [scale ((get-in entities [:room :scale-fn]) [90 138])]

View File

@@ -224,7 +224,7 @@
:collision "outside-jail/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 40 0.001 1.3)
:start-pos [145 15]
:apply-state (fn [entities]
:apply-state (fn [_ entities]
(as-> entities entities
(if (= :night (get-in entities [:state :time]))
(make-night entities)

View File

@@ -187,7 +187,7 @@
{}
:layers [(assoc (texture "space/background.png") :x 0 :y 0 :baseline 0)]
:timers {:taunt [10.0 8.0 taunt]
:shock [5.0 1.0 shock]}
:shock [5.0 15.0 shock]}
:entities {:appear (assoc effect
:x 240 :y 50
:baseline 200)
@@ -262,7 +262,9 @@
(Thread/sleep 5000)
(actions/do-dialogue entities
:bloodclot-head "Argh! My lightning gem!"
:bloodclot-head "No matter. I will rip you apart with my bare hands!"))})}
:bloodclot-head "No matter. I will rip you apart with my bare hands!")
(actions/pause-camera entities)
(actions/transition-background entities :held [125 170]))})}
:bullet (assoc (animation->texture screen bullet)
:x 37 :y 85 :baseline 241
:walk bullet)
@@ -271,7 +273,7 @@
:collision "space/collision.png"
:scale-fn (constantly 1.5)
:start-pos [35 45]
:apply-state (fn [e]
:apply-state (fn [_ e]
(as-> e e
(if (get-in e [:state :broke-jewel?])
(assoc-in e [:room :entities :broken-jewel] (get-in e [:room :entities :broken-jewel]))