added outside particles. Nice effect.

This commit is contained in:
2015-07-27 19:02:59 -07:00
parent f523ab31b5
commit ae91eceee2
9 changed files with 457 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
(ns advent.screens.rooms.behind-house
(:require [advent.screens.rooms :as rooms]
[advent.screens.rooms.common :as common]
[advent.screens.items :as items]
[advent.actions :as actions]
[advent.utils :as utils]
@@ -85,10 +86,12 @@
(actions/play-animation entities :ego :reach)
(actions/update-entity entities :peeling #(assoc % :opacity 0))
(actions/update-state entities (fn [state] (assoc state :opened-crack? true)))))))
:bird (utils/make-bird screen [[50 235] [80 220] [100 239] [180 235] [85 225]])}
:bird (utils/make-bird screen [[50 235] [80 220] [100 239] [180 235] [85 225]])
:outside-particles (common/make-outside-particles)}
:collision "behindhouse/collision.png"
:scale-fn (utils/scaler-fn-with-baseline 110 0.10 1.00)
:apply-state (fn [_ entities]
(utils/fast-forward-particle (get-in entities [:room :entities :outside-particles]))
(as-> entities entities
(if (get-in entities [:state :opened-crack?])
(assoc-in entities [:room :entities :peeling :opacity] 0)