start with correct scale.

This commit is contained in:
2014-12-14 18:11:32 -08:00
parent 77e7d7f59c
commit 3ca729d2f7

View File

@@ -86,7 +86,7 @@
entities))))
(defn get-ego [screen start-pos]
(defn get-ego [screen start-pos start-scale]
(let [player-sheet (texture! (texture "player.png") :split 18 36)
talk-sheet (texture! (texture "ego/talk.png") :split 18 36)
stand-sheet (texture! (texture "ego/stand.png") :split 18 36)
@@ -163,6 +163,8 @@
:origin-y 0
:scaled true
:step-sound (sound "ego/step.ogg")
:scale-x start-scale
:scale-y start-scale
:mouse-in? (fn [entities x y]
(let [{entity-x :x entity-y :y region :object scale :scale-x} (get-in entities [:room :entities :ego])
@@ -280,7 +282,7 @@
:override nil}
:all-items (assoc items/items :object nil)
:room (as-> (get rooms (:last-room (get-state))) room
(assoc-in room [:entities :ego] (get-ego screen (:start-pos room))))
(assoc-in room [:entities :ego] (get-ego screen (:start-pos room) ((:scale-fn room) (:start-pos room)))))
:inventory (assoc (texture "inventory.png") :x 278 :y 0 :baseline 9000
:mouse-in? (zone/box 278 0 320 42))
:fps (assoc (label "0" (color :white) ) :x 5 :baseline 0)}]