this makes the game feel good.

This commit is contained in:
2015-02-19 12:33:09 -08:00
parent c6dc550e1f
commit 163f5b9376
2 changed files with 44 additions and 25 deletions

View File

@@ -488,6 +488,19 @@
(if (:update-fn entity)
[id ((:update-fn entity) screen entities entity)]
[id entity])))))
entities (if (and (nil? (get-in entities [:tweens :cam-x]))
(= 1 (rand-int 40)))
(actions/pan-to screen entities
(+ (get-in entities [:room :entities :ego :x])
(- (rand-int 20) 10))
(+ (get-in entities [:room :entities :ego :y])
(- (rand-int 20) 10))
(constantly (get-in entities [:room :entities :ego :scale-x]))
tween/ease-in-out-quadratic
5.0)
entities)
layers (get-layers entities)